proteus  1.7.3.dev0
C/C++/Fortran libraries
BoundaryConditions.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
328  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
329  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
330 #else
331  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
332  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
333 #endif
334  #define __Pyx_DefaultClassType PyType_Type
335 #endif
336 #ifndef Py_TPFLAGS_CHECKTYPES
337  #define Py_TPFLAGS_CHECKTYPES 0
338 #endif
339 #ifndef Py_TPFLAGS_HAVE_INDEX
340  #define Py_TPFLAGS_HAVE_INDEX 0
341 #endif
342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
343  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
344 #endif
345 #ifndef Py_TPFLAGS_HAVE_FINALIZE
346  #define Py_TPFLAGS_HAVE_FINALIZE 0
347 #endif
348 #ifndef METH_STACKLESS
349  #define METH_STACKLESS 0
350 #endif
351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
352  #ifndef METH_FASTCALL
353  #define METH_FASTCALL 0x80
354  #endif
355  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
356  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
357  Py_ssize_t nargs, PyObject *kwnames);
358 #else
359  #define __Pyx_PyCFunctionFast _PyCFunctionFast
360  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
361 #endif
362 #if CYTHON_FAST_PYCCALL
363 #define __Pyx_PyFastCFunction_Check(func)\
364  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
365 #else
366 #define __Pyx_PyFastCFunction_Check(func) 0
367 #endif
368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
369  #define PyObject_Malloc(s) PyMem_Malloc(s)
370  #define PyObject_Free(p) PyMem_Free(p)
371  #define PyObject_Realloc(p) PyMem_Realloc(p)
372 #endif
373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
374  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
375  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
376  #define PyMem_RawFree(p) PyMem_Free(p)
377 #endif
378 #if CYTHON_COMPILING_IN_PYSTON
379  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
380  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
381 #else
382  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
383  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
384 #endif
385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
386  #define __Pyx_PyThreadState_Current PyThreadState_GET()
387 #elif PY_VERSION_HEX >= 0x03060000
388  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
389 #elif PY_VERSION_HEX >= 0x03000000
390  #define __Pyx_PyThreadState_Current PyThreadState_GET()
391 #else
392  #define __Pyx_PyThreadState_Current _PyThreadState_Current
393 #endif
394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
395 #include "pythread.h"
396 #define Py_tss_NEEDS_INIT 0
397 typedef int Py_tss_t;
398 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
399  *key = PyThread_create_key();
400  return 0;
401 }
402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
403  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
404  *key = Py_tss_NEEDS_INIT;
405  return key;
406 }
407 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
408  PyObject_Free(key);
409 }
410 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
411  return *key != Py_tss_NEEDS_INIT;
412 }
413 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
414  PyThread_delete_key(*key);
415  *key = Py_tss_NEEDS_INIT;
416 }
417 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
418  return PyThread_set_key_value(*key, value);
419 }
420 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
421  return PyThread_get_key_value(*key);
422 }
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
426 #else
427 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
428 #endif
429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
430  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
431  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
432 #else
433  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
434  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
435 #endif
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
438 #else
439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
440 #endif
441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
442  #define CYTHON_PEP393_ENABLED 1
443  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
444  0 : _PyUnicode_Ready((PyObject *)(op)))
445  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
446  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
447  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
448  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
449  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
450  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
451  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
452  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
453  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
454  #else
455  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
456  #endif
457 #else
458  #define CYTHON_PEP393_ENABLED 0
459  #define PyUnicode_1BYTE_KIND 1
460  #define PyUnicode_2BYTE_KIND 2
461  #define PyUnicode_4BYTE_KIND 4
462  #define __Pyx_PyUnicode_READY(op) (0)
463  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
464  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
465  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
466  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
467  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
468  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
469  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
470  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY
473  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
474  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
475 #else
476  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
477  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
478  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
479 #endif
480 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
481  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
484  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
485 #endif
486 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
487  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
488 #endif
489 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
490 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
491 #if PY_MAJOR_VERSION >= 3
492  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
493 #else
494  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
495 #endif
496 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
497  #define PyObject_ASCII(o) PyObject_Repr(o)
498 #endif
499 #if PY_MAJOR_VERSION >= 3
500  #define PyBaseString_Type PyUnicode_Type
501  #define PyStringObject PyUnicodeObject
502  #define PyString_Type PyUnicode_Type
503  #define PyString_Check PyUnicode_Check
504  #define PyString_CheckExact PyUnicode_CheckExact
505 #ifndef PyObject_Unicode
506  #define PyObject_Unicode PyObject_Str
507 #endif
508 #endif
509 #if PY_MAJOR_VERSION >= 3
510  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
511  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
512 #else
513  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
514  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
515 #endif
516 #ifndef PySet_CheckExact
517  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
518 #endif
519 #if PY_VERSION_HEX >= 0x030900A4
520  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
521  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
522 #else
523  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
524  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
525 #endif
526 #if CYTHON_ASSUME_SAFE_MACROS
527  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
528 #else
529  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
530 #endif
531 #if PY_MAJOR_VERSION >= 3
532  #define PyIntObject PyLongObject
533  #define PyInt_Type PyLong_Type
534  #define PyInt_Check(op) PyLong_Check(op)
535  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
536  #define PyInt_FromString PyLong_FromString
537  #define PyInt_FromUnicode PyLong_FromUnicode
538  #define PyInt_FromLong PyLong_FromLong
539  #define PyInt_FromSize_t PyLong_FromSize_t
540  #define PyInt_FromSsize_t PyLong_FromSsize_t
541  #define PyInt_AsLong PyLong_AsLong
542  #define PyInt_AS_LONG PyLong_AS_LONG
543  #define PyInt_AsSsize_t PyLong_AsSsize_t
544  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
545  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
546  #define PyNumber_Int PyNumber_Long
547 #endif
548 #if PY_MAJOR_VERSION >= 3
549  #define PyBoolObject PyLongObject
550 #endif
551 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
552  #ifndef PyUnicode_InternFromString
553  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
554  #endif
555 #endif
556 #if PY_VERSION_HEX < 0x030200A4
557  typedef long Py_hash_t;
558  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
559  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
560 #else
561  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
562  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
563 #endif
564 #if PY_MAJOR_VERSION >= 3
565  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
566 #else
567  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
568 #endif
569 #if CYTHON_USE_ASYNC_SLOTS
570  #if PY_VERSION_HEX >= 0x030500B1
571  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
572  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
573  #else
574  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
575  #endif
576 #else
577  #define __Pyx_PyType_AsAsync(obj) NULL
578 #endif
579 #ifndef __Pyx_PyAsyncMethodsStruct
580  typedef struct {
581  unaryfunc am_await;
582  unaryfunc am_aiter;
583  unaryfunc am_anext;
584  } __Pyx_PyAsyncMethodsStruct;
585 #endif
586 
587 #if defined(WIN32) || defined(MS_WINDOWS)
588  #define _USE_MATH_DEFINES
589 #endif
590 #include <math.h>
591 #ifdef NAN
592 #define __PYX_NAN() ((float) NAN)
593 #else
594 static CYTHON_INLINE float __PYX_NAN() {
595  float value;
596  memset(&value, 0xFF, sizeof(value));
597  return value;
598 }
599 #endif
600 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
601 #define __Pyx_truncl trunc
602 #else
603 #define __Pyx_truncl truncl
604 #endif
605 
606 #define __PYX_MARK_ERR_POS(f_index, lineno) \
607  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
608 #define __PYX_ERR(f_index, lineno, Ln_error) \
609  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
610 
611 #ifndef __PYX_EXTERN_C
612  #ifdef __cplusplus
613  #define __PYX_EXTERN_C extern "C"
614  #else
615  #define __PYX_EXTERN_C extern
616  #endif
617 #endif
618 
619 #define __PYX_HAVE__BoundaryConditions
620 #define __PYX_HAVE_API__BoundaryConditions
621 /* Early includes */
622 #include <string.h>
623 #include <stdio.h>
624 #include "numpy/arrayobject.h"
625 #include "numpy/ufuncobject.h"
626 
627  /* NumPy API declarations from "numpy/__init__.pxd" */
628 
629 #include "pythread.h"
630 #include <stdlib.h>
631 #include "pystate.h"
632 #ifdef _OPENMP
633 #include <omp.h>
634 #endif /* _OPENMP */
635 
636 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
637 #define CYTHON_WITHOUT_ASSERTIONS
638 #endif
639 
640 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
641  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
642 
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
645 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
646 #define __PYX_DEFAULT_STRING_ENCODING ""
647 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
648 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
649 #define __Pyx_uchar_cast(c) ((unsigned char)c)
650 #define __Pyx_long_cast(x) ((long)x)
651 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
652  (sizeof(type) < sizeof(Py_ssize_t)) ||\
653  (sizeof(type) > sizeof(Py_ssize_t) &&\
654  likely(v < (type)PY_SSIZE_T_MAX ||\
655  v == (type)PY_SSIZE_T_MAX) &&\
656  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
657  v == (type)PY_SSIZE_T_MIN))) ||\
658  (sizeof(type) == sizeof(Py_ssize_t) &&\
659  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
660  v == (type)PY_SSIZE_T_MAX))) )
661 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
662  return (size_t) i < (size_t) limit;
663 }
664 #if defined (__cplusplus) && __cplusplus >= 201103L
665  #include <cstdlib>
666  #define __Pyx_sst_abs(value) std::abs(value)
667 #elif SIZEOF_INT >= SIZEOF_SIZE_T
668  #define __Pyx_sst_abs(value) abs(value)
669 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
670  #define __Pyx_sst_abs(value) labs(value)
671 #elif defined (_MSC_VER)
672  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
673 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
674  #define __Pyx_sst_abs(value) llabs(value)
675 #elif defined (__GNUC__)
676  #define __Pyx_sst_abs(value) __builtin_llabs(value)
677 #else
678  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
679 #endif
680 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
681 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
682 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
683 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
684 #define __Pyx_PyBytes_FromString PyBytes_FromString
685 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
686 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
687 #if PY_MAJOR_VERSION < 3
688  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
689  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
690 #else
691  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
692  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
693 #endif
694 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
706 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
707 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
708 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
709 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
710 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
711  const Py_UNICODE *u_end = u;
712  while (*u_end++) ;
713  return (size_t)(u_end - u - 1);
714 }
715 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
716 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
717 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
718 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
719 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
720 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
721 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
722 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
723 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
724 #define __Pyx_PySequence_Tuple(obj)\
725  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
726 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
727 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
728 #if CYTHON_ASSUME_SAFE_MACROS
729 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
730 #else
731 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
732 #endif
733 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
734 #if PY_MAJOR_VERSION >= 3
735 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
736 #else
737 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
738 #endif
739 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
740 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
741 static int __Pyx_sys_getdefaultencoding_not_ascii;
742 static int __Pyx_init_sys_getdefaultencoding_params(void) {
743  PyObject* sys;
744  PyObject* default_encoding = NULL;
745  PyObject* ascii_chars_u = NULL;
746  PyObject* ascii_chars_b = NULL;
747  const char* default_encoding_c;
748  sys = PyImport_ImportModule("sys");
749  if (!sys) goto bad;
750  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
751  Py_DECREF(sys);
752  if (!default_encoding) goto bad;
753  default_encoding_c = PyBytes_AsString(default_encoding);
754  if (!default_encoding_c) goto bad;
755  if (strcmp(default_encoding_c, "ascii") == 0) {
756  __Pyx_sys_getdefaultencoding_not_ascii = 0;
757  } else {
758  char ascii_chars[128];
759  int c;
760  for (c = 0; c < 128; c++) {
761  ascii_chars[c] = c;
762  }
763  __Pyx_sys_getdefaultencoding_not_ascii = 1;
764  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
765  if (!ascii_chars_u) goto bad;
766  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
767  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
768  PyErr_Format(
769  PyExc_ValueError,
770  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
771  default_encoding_c);
772  goto bad;
773  }
774  Py_DECREF(ascii_chars_u);
775  Py_DECREF(ascii_chars_b);
776  }
777  Py_DECREF(default_encoding);
778  return 0;
779 bad:
780  Py_XDECREF(default_encoding);
781  Py_XDECREF(ascii_chars_u);
782  Py_XDECREF(ascii_chars_b);
783  return -1;
784 }
785 #endif
786 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
788 #else
789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
790 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
791 static char* __PYX_DEFAULT_STRING_ENCODING;
792 static int __Pyx_init_sys_getdefaultencoding_params(void) {
793  PyObject* sys;
794  PyObject* default_encoding = NULL;
795  char* default_encoding_c;
796  sys = PyImport_ImportModule("sys");
797  if (!sys) goto bad;
798  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
799  Py_DECREF(sys);
800  if (!default_encoding) goto bad;
801  default_encoding_c = PyBytes_AsString(default_encoding);
802  if (!default_encoding_c) goto bad;
803  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
804  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
805  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
806  Py_DECREF(default_encoding);
807  return 0;
808 bad:
809  Py_XDECREF(default_encoding);
810  return -1;
811 }
812 #endif
813 #endif
814 
815 
816 /* Test for GCC > 2.95 */
817 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
818  #define likely(x) __builtin_expect(!!(x), 1)
819  #define unlikely(x) __builtin_expect(!!(x), 0)
820 #else /* !__GNUC__ or GCC < 2.95 */
821  #define likely(x) (x)
822  #define unlikely(x) (x)
823 #endif /* __GNUC__ */
824 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
825 
826 static PyObject *__pyx_m = NULL;
827 static PyObject *__pyx_d;
828 static PyObject *__pyx_b;
829 static PyObject *__pyx_cython_runtime = NULL;
830 static PyObject *__pyx_empty_tuple;
831 static PyObject *__pyx_empty_bytes;
832 static PyObject *__pyx_empty_unicode;
833 static int __pyx_lineno;
834 static int __pyx_clineno = 0;
835 static const char * __pyx_cfilenm= __FILE__;
836 static const char *__pyx_filename;
837 
838 /* Header.proto */
839 #if !defined(CYTHON_CCOMPLEX)
840  #if defined(__cplusplus)
841  #define CYTHON_CCOMPLEX 1
842  #elif defined(_Complex_I)
843  #define CYTHON_CCOMPLEX 1
844  #else
845  #define CYTHON_CCOMPLEX 0
846  #endif
847 #endif
848 #if CYTHON_CCOMPLEX
849  #ifdef __cplusplus
850  #include <complex>
851  #else
852  #include <complex.h>
853  #endif
854 #endif
855 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
856  #undef _Complex_I
857  #define _Complex_I 1.0fj
858 #endif
859 
860 
861 static const char *__pyx_f[] = {
862  "proteus/BoundaryConditions.py",
863  "stringsource",
864  "proteus/BoundaryConditions.pxd",
865  "__init__.pxd",
866  "type.pxd",
867 };
868 /* MemviewSliceStruct.proto */
869 struct __pyx_memoryview_obj;
870 typedef struct {
871  struct __pyx_memoryview_obj *memview;
872  char *data;
873  Py_ssize_t shape[8];
874  Py_ssize_t strides[8];
875  Py_ssize_t suboffsets[8];
876 } __Pyx_memviewslice;
877 #define __Pyx_MemoryView_Len(m) (m.shape[0])
878 
879 /* Atomics.proto */
880 #include <pythread.h>
881 #ifndef CYTHON_ATOMICS
882  #define CYTHON_ATOMICS 1
883 #endif
884 #define __pyx_atomic_int_type int
885 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
886  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
887  !defined(__i386__)
888  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
889  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
890  #ifdef __PYX_DEBUG_ATOMICS
891  #warning "Using GNU atomics"
892  #endif
893 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
894  #include <Windows.h>
895  #undef __pyx_atomic_int_type
896  #define __pyx_atomic_int_type LONG
897  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
898  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
899  #ifdef __PYX_DEBUG_ATOMICS
900  #pragma message ("Using MSVC atomics")
901  #endif
902 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
903  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
904  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
905  #ifdef __PYX_DEBUG_ATOMICS
906  #warning "Using Intel atomics"
907  #endif
908 #else
909  #undef CYTHON_ATOMICS
910  #define CYTHON_ATOMICS 0
911  #ifdef __PYX_DEBUG_ATOMICS
912  #warning "Not using atomics"
913  #endif
914 #endif
915 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
916 #if CYTHON_ATOMICS
917  #define __pyx_add_acquisition_count(memview)\
918  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
919  #define __pyx_sub_acquisition_count(memview)\
920  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
921 #else
922  #define __pyx_add_acquisition_count(memview)\
923  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
924  #define __pyx_sub_acquisition_count(memview)\
925  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
926 #endif
927 
928 /* ForceInitThreads.proto */
929 #ifndef __PYX_FORCE_INIT_THREADS
930  #define __PYX_FORCE_INIT_THREADS 0
931 #endif
932 
933 /* NoFastGil.proto */
934 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
935 #define __Pyx_PyGILState_Release PyGILState_Release
936 #define __Pyx_FastGIL_Remember()
937 #define __Pyx_FastGIL_Forget()
938 #define __Pyx_FastGilFuncInit()
939 
940 /* BufferFormatStructs.proto */
941 #define IS_UNSIGNED(type) (((type) -1) > 0)
942 struct __Pyx_StructField_;
943 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
944 typedef struct {
945  const char* name;
946  struct __Pyx_StructField_* fields;
947  size_t size;
948  size_t arraysize[8];
949  int ndim;
950  char typegroup;
951  char is_unsigned;
952  int flags;
953 } __Pyx_TypeInfo;
954 typedef struct __Pyx_StructField_ {
955  __Pyx_TypeInfo* type;
956  const char* name;
957  size_t offset;
958 } __Pyx_StructField;
959 typedef struct {
960  __Pyx_StructField* field;
961  size_t parent_offset;
962 } __Pyx_BufFmt_StackElem;
963 typedef struct {
964  __Pyx_StructField root;
965  __Pyx_BufFmt_StackElem* head;
966  size_t fmt_offset;
967  size_t new_count, enc_count;
968  size_t struct_alignment;
969  int is_complex;
970  char enc_type;
971  char new_packmode;
972  char enc_packmode;
973  char is_valid_array;
974 } __Pyx_BufFmt_Context;
975 
976 
977 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":697
978  * # in Cython to enable them only on the right systems.
979  *
980  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
981  * ctypedef npy_int16 int16_t
982  * ctypedef npy_int32 int32_t
983  */
984 typedef npy_int8 __pyx_t_5numpy_int8_t;
985 
986 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":698
987  *
988  * ctypedef npy_int8 int8_t
989  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
990  * ctypedef npy_int32 int32_t
991  * ctypedef npy_int64 int64_t
992  */
993 typedef npy_int16 __pyx_t_5numpy_int16_t;
994 
995 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":699
996  * ctypedef npy_int8 int8_t
997  * ctypedef npy_int16 int16_t
998  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
999  * ctypedef npy_int64 int64_t
1000  * #ctypedef npy_int96 int96_t
1001  */
1002 typedef npy_int32 __pyx_t_5numpy_int32_t;
1003 
1004 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":700
1005  * ctypedef npy_int16 int16_t
1006  * ctypedef npy_int32 int32_t
1007  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1008  * #ctypedef npy_int96 int96_t
1009  * #ctypedef npy_int128 int128_t
1010  */
1011 typedef npy_int64 __pyx_t_5numpy_int64_t;
1012 
1013 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":704
1014  * #ctypedef npy_int128 int128_t
1015  *
1016  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1017  * ctypedef npy_uint16 uint16_t
1018  * ctypedef npy_uint32 uint32_t
1019  */
1020 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1021 
1022 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":705
1023  *
1024  * ctypedef npy_uint8 uint8_t
1025  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1026  * ctypedef npy_uint32 uint32_t
1027  * ctypedef npy_uint64 uint64_t
1028  */
1029 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1030 
1031 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":706
1032  * ctypedef npy_uint8 uint8_t
1033  * ctypedef npy_uint16 uint16_t
1034  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1035  * ctypedef npy_uint64 uint64_t
1036  * #ctypedef npy_uint96 uint96_t
1037  */
1038 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1039 
1040 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":707
1041  * ctypedef npy_uint16 uint16_t
1042  * ctypedef npy_uint32 uint32_t
1043  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1044  * #ctypedef npy_uint96 uint96_t
1045  * #ctypedef npy_uint128 uint128_t
1046  */
1047 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1048 
1049 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":711
1050  * #ctypedef npy_uint128 uint128_t
1051  *
1052  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1053  * ctypedef npy_float64 float64_t
1054  * #ctypedef npy_float80 float80_t
1055  */
1056 typedef npy_float32 __pyx_t_5numpy_float32_t;
1057 
1058 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":712
1059  *
1060  * ctypedef npy_float32 float32_t
1061  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1062  * #ctypedef npy_float80 float80_t
1063  * #ctypedef npy_float128 float128_t
1064  */
1065 typedef npy_float64 __pyx_t_5numpy_float64_t;
1066 
1067 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":721
1068  * # The int types are mapped a bit surprising --
1069  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1070  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1071  * ctypedef npy_longlong long_t
1072  * ctypedef npy_longlong longlong_t
1073  */
1074 typedef npy_long __pyx_t_5numpy_int_t;
1075 
1076 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":722
1077  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1078  * ctypedef npy_long int_t
1079  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1080  * ctypedef npy_longlong longlong_t
1081  *
1082  */
1083 typedef npy_longlong __pyx_t_5numpy_long_t;
1084 
1085 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":723
1086  * ctypedef npy_long int_t
1087  * ctypedef npy_longlong long_t
1088  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1089  *
1090  * ctypedef npy_ulong uint_t
1091  */
1092 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1093 
1094 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":725
1095  * ctypedef npy_longlong longlong_t
1096  *
1097  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1098  * ctypedef npy_ulonglong ulong_t
1099  * ctypedef npy_ulonglong ulonglong_t
1100  */
1101 typedef npy_ulong __pyx_t_5numpy_uint_t;
1102 
1103 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":726
1104  *
1105  * ctypedef npy_ulong uint_t
1106  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1107  * ctypedef npy_ulonglong ulonglong_t
1108  *
1109  */
1110 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1111 
1112 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":727
1113  * ctypedef npy_ulong uint_t
1114  * ctypedef npy_ulonglong ulong_t
1115  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1116  *
1117  * ctypedef npy_intp intp_t
1118  */
1119 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1120 
1121 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":729
1122  * ctypedef npy_ulonglong ulonglong_t
1123  *
1124  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1125  * ctypedef npy_uintp uintp_t
1126  *
1127  */
1128 typedef npy_intp __pyx_t_5numpy_intp_t;
1129 
1130 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":730
1131  *
1132  * ctypedef npy_intp intp_t
1133  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1134  *
1135  * ctypedef npy_double float_t
1136  */
1137 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1138 
1139 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":732
1140  * ctypedef npy_uintp uintp_t
1141  *
1142  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1143  * ctypedef npy_double double_t
1144  * ctypedef npy_longdouble longdouble_t
1145  */
1146 typedef npy_double __pyx_t_5numpy_float_t;
1147 
1148 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":733
1149  *
1150  * ctypedef npy_double float_t
1151  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1152  * ctypedef npy_longdouble longdouble_t
1153  *
1154  */
1155 typedef npy_double __pyx_t_5numpy_double_t;
1156 
1157 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":734
1158  * ctypedef npy_double float_t
1159  * ctypedef npy_double double_t
1160  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1161  *
1162  * ctypedef npy_cfloat cfloat_t
1163  */
1164 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1165 /* Declarations.proto */
1166 #if CYTHON_CCOMPLEX
1167  #ifdef __cplusplus
1168  typedef ::std::complex< float > __pyx_t_float_complex;
1169  #else
1170  typedef float _Complex __pyx_t_float_complex;
1171  #endif
1172 #else
1173  typedef struct { float real, imag; } __pyx_t_float_complex;
1174 #endif
1175 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1176 
1177 /* Declarations.proto */
1178 #if CYTHON_CCOMPLEX
1179  #ifdef __cplusplus
1180  typedef ::std::complex< double > __pyx_t_double_complex;
1181  #else
1182  typedef double _Complex __pyx_t_double_complex;
1183  #endif
1184 #else
1185  typedef struct { double real, imag; } __pyx_t_double_complex;
1186 #endif
1187 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1188 
1189 
1190 /*--- Type declarations ---*/
1191 struct __pyx_obj_18BoundaryConditions_BC_Base;
1192 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1193 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1194 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1195 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1196 struct __pyx_array_obj;
1197 struct __pyx_MemviewEnum_obj;
1198 struct __pyx_memoryview_obj;
1199 struct __pyx_memoryviewslice_obj;
1200 
1201 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":736
1202  * ctypedef npy_longdouble longdouble_t
1203  *
1204  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1205  * ctypedef npy_cdouble cdouble_t
1206  * ctypedef npy_clongdouble clongdouble_t
1207  */
1208 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1209 
1210 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":737
1211  *
1212  * ctypedef npy_cfloat cfloat_t
1213  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1214  * ctypedef npy_clongdouble clongdouble_t
1215  *
1216  */
1217 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1218 
1219 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":738
1220  * ctypedef npy_cfloat cfloat_t
1221  * ctypedef npy_cdouble cdouble_t
1222  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1223  *
1224  * ctypedef npy_cdouble complex_t
1225  */
1226 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1227 
1228 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":740
1229  * ctypedef npy_clongdouble clongdouble_t
1230  *
1231  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1232  *
1233  * cdef inline object PyArray_MultiIterNew1(a):
1234  */
1235 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1236 struct __pyx_defaults;
1237 typedef struct __pyx_defaults __pyx_defaults;
1238 struct __pyx_defaults1;
1239 typedef struct __pyx_defaults1 __pyx_defaults1;
1240 struct __pyx_defaults2;
1241 typedef struct __pyx_defaults2 __pyx_defaults2;
1242 
1243 /* "BoundaryConditions.pxd":16
1244  * # cpdef void getContext(BC_Base cls, object context=*)
1245  *
1246  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1247  * cdef class BoundaryCondition:
1248  * cdef cpp_uOfXT uuOfXT
1249  */
1250 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1251 struct __pyx_defaults {
1252  PyObject *__pyx_arg_n;
1253 };
1254 struct __pyx_defaults1 {
1255  PyObject *__pyx_arg_n;
1256 };
1257 struct __pyx_defaults2 {
1258  PyObject *__pyx_arg_n;
1259 };
1260 
1261 /* "BoundaryConditions.pxd":5
1262  * import cython
1263  *
1264  * cdef class BC_Base: # <<<<<<<<<<<<<<
1265  * cdef double[:] _b_or
1266  * cdef public:
1267  */
1268 struct __pyx_obj_18BoundaryConditions_BC_Base {
1269  PyObject_HEAD
1270  __Pyx_memviewslice _b_or;
1271  int nd;
1272  PyObject *Shape;
1273  PyObject *name;
1274  PyObject *BC_type;
1275  PyObject *ct;
1276 };
1277 
1278 
1279 /* "BoundaryConditions.pxd":17
1280  *
1281  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1282  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1283  * cdef cpp_uOfXT uuOfXT
1284  * cdef public:
1285  */
1286 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1287  PyObject_HEAD
1288  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1289  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1290  PyObject *uOfXT;
1291 };
1292 
1293 
1294 /* "BoundaryConditions.py":87
1295  * self.uOfXT = None
1296  *
1297  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1298  * """
1299  * function returning constant BC
1300  */
1301 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1302  PyObject_HEAD
1303  PyObject *__pyx_v_value;
1304 };
1305 
1306 
1307 /* "BoundaryConditions.py":100
1308  *
1309  *
1310  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
1311  * """
1312  * function returning value=a0+ax*x+ay*y+az*z
1313  */
1314 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1315  PyObject_HEAD
1316  PyObject *__pyx_v_a;
1317  PyObject *__pyx_v_a0;
1318 };
1319 
1320 
1321 /* "BoundaryConditions.py":115
1322  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
1323  *
1324  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
1325  * """
1326  * function setting a linear ramp from t=0 to t=t1
1327  */
1328 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1329  PyObject_HEAD
1330  PyObject *__pyx_v_t1;
1331  PyObject *__pyx_v_value;
1332 };
1333 
1334 
1335 /* "View.MemoryView":105
1336  *
1337  * @cname("__pyx_array")
1338  * cdef class array: # <<<<<<<<<<<<<<
1339  *
1340  * cdef:
1341  */
1342 struct __pyx_array_obj {
1343  PyObject_HEAD
1344  struct __pyx_vtabstruct_array *__pyx_vtab;
1345  char *data;
1346  Py_ssize_t len;
1347  char *format;
1348  int ndim;
1349  Py_ssize_t *_shape;
1350  Py_ssize_t *_strides;
1351  Py_ssize_t itemsize;
1352  PyObject *mode;
1353  PyObject *_format;
1354  void (*callback_free_data)(void *);
1355  int free_data;
1356  int dtype_is_object;
1357 };
1358 
1359 
1360 /* "View.MemoryView":279
1361  *
1362  * @cname('__pyx_MemviewEnum')
1363  * cdef class Enum(object): # <<<<<<<<<<<<<<
1364  * cdef object name
1365  * def __init__(self, name):
1366  */
1367 struct __pyx_MemviewEnum_obj {
1368  PyObject_HEAD
1369  PyObject *name;
1370 };
1371 
1372 
1373 /* "View.MemoryView":330
1374  *
1375  * @cname('__pyx_memoryview')
1376  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1377  *
1378  * cdef object obj
1379  */
1380 struct __pyx_memoryview_obj {
1381  PyObject_HEAD
1382  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1383  PyObject *obj;
1384  PyObject *_size;
1385  PyObject *_array_interface;
1386  PyThread_type_lock lock;
1387  __pyx_atomic_int acquisition_count[2];
1388  __pyx_atomic_int *acquisition_count_aligned_p;
1389  Py_buffer view;
1390  int flags;
1391  int dtype_is_object;
1392  __Pyx_TypeInfo *typeinfo;
1393 };
1394 
1395 
1396 /* "View.MemoryView":965
1397  *
1398  * @cname('__pyx_memoryviewslice')
1399  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1400  * "Internal class for passing memoryview slices to Python"
1401  *
1402  */
1403 struct __pyx_memoryviewslice_obj {
1404  struct __pyx_memoryview_obj __pyx_base;
1405  __Pyx_memviewslice from_slice;
1406  PyObject *from_object;
1407  PyObject *(*to_object_func)(char *);
1408  int (*to_dtype_func)(char *, PyObject *);
1409 };
1410 
1411 
1412 
1413 /* "BoundaryConditions.py":68
1414  *
1415  *
1416  * class BoundaryCondition: # <<<<<<<<<<<<<<
1417  * """
1418  * Boundary condition class
1419  */
1420 
1421 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1422  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1423 };
1424 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1425 
1426 
1427 /* "View.MemoryView":105
1428  *
1429  * @cname("__pyx_array")
1430  * cdef class array: # <<<<<<<<<<<<<<
1431  *
1432  * cdef:
1433  */
1434 
1435 struct __pyx_vtabstruct_array {
1436  PyObject *(*get_memview)(struct __pyx_array_obj *);
1437 };
1438 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1439 
1440 
1441 /* "View.MemoryView":330
1442  *
1443  * @cname('__pyx_memoryview')
1444  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1445  *
1446  * cdef object obj
1447  */
1448 
1449 struct __pyx_vtabstruct_memoryview {
1450  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1451  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1452  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1453  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1454  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1455  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1456  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1457 };
1458 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1459 
1460 
1461 /* "View.MemoryView":965
1462  *
1463  * @cname('__pyx_memoryviewslice')
1464  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1465  * "Internal class for passing memoryview slices to Python"
1466  *
1467  */
1468 
1469 struct __pyx_vtabstruct__memoryviewslice {
1470  struct __pyx_vtabstruct_memoryview __pyx_base;
1471 };
1472 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1473 
1474 /* --- Runtime support code (head) --- */
1475 /* Refnanny.proto */
1476 #ifndef CYTHON_REFNANNY
1477  #define CYTHON_REFNANNY 0
1478 #endif
1479 #if CYTHON_REFNANNY
1480  typedef struct {
1481  void (*INCREF)(void*, PyObject*, int);
1482  void (*DECREF)(void*, PyObject*, int);
1483  void (*GOTREF)(void*, PyObject*, int);
1484  void (*GIVEREF)(void*, PyObject*, int);
1485  void* (*SetupContext)(const char*, int, const char*);
1486  void (*FinishContext)(void**);
1487  } __Pyx_RefNannyAPIStruct;
1488  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1489  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1490  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1491 #ifdef WITH_THREAD
1492  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1493  if (acquire_gil) {\
1494  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1495  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1496  PyGILState_Release(__pyx_gilstate_save);\
1497  } else {\
1498  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1499  }
1500 #else
1501  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1502  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1503 #endif
1504  #define __Pyx_RefNannyFinishContext()\
1505  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1506  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1507  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1510  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1511  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1512  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1513  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1514 #else
1515  #define __Pyx_RefNannyDeclarations
1516  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1517  #define __Pyx_RefNannyFinishContext()
1518  #define __Pyx_INCREF(r) Py_INCREF(r)
1519  #define __Pyx_DECREF(r) Py_DECREF(r)
1520  #define __Pyx_GOTREF(r)
1521  #define __Pyx_GIVEREF(r)
1522  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1523  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1524  #define __Pyx_XGOTREF(r)
1525  #define __Pyx_XGIVEREF(r)
1526 #endif
1527 #define __Pyx_XDECREF_SET(r, v) do {\
1528  PyObject *tmp = (PyObject *) r;\
1529  r = v; __Pyx_XDECREF(tmp);\
1530  } while (0)
1531 #define __Pyx_DECREF_SET(r, v) do {\
1532  PyObject *tmp = (PyObject *) r;\
1533  r = v; __Pyx_DECREF(tmp);\
1534  } while (0)
1535 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1536 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1537 
1538 /* PyObjectGetAttrStr.proto */
1539 #if CYTHON_USE_TYPE_SLOTS
1540 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1541 #else
1542 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1543 #endif
1544 
1545 /* GetBuiltinName.proto */
1546 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1547 
1548 /* RaiseDoubleKeywords.proto */
1549 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1550 
1551 /* ParseKeywords.proto */
1552 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1553  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1554  const char* function_name);
1555 
1556 /* RaiseArgTupleInvalid.proto */
1557 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1558  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1559 
1560 /* PyThreadStateGet.proto */
1561 #if CYTHON_FAST_THREAD_STATE
1562 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1563 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1564 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1565 #else
1566 #define __Pyx_PyThreadState_declare
1567 #define __Pyx_PyThreadState_assign
1568 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1569 #endif
1570 
1571 /* PyErrFetchRestore.proto */
1572 #if CYTHON_FAST_THREAD_STATE
1573 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1574 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1575 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1576 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1577 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1578 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1579 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1580 #if CYTHON_COMPILING_IN_CPYTHON
1581 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1582 #else
1583 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1584 #endif
1585 #else
1586 #define __Pyx_PyErr_Clear() PyErr_Clear()
1587 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1588 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1589 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1590 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1591 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1592 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1593 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1594 #endif
1595 
1596 /* Profile.proto */
1597 #ifndef CYTHON_PROFILE
1598 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1599  #define CYTHON_PROFILE 0
1600 #else
1601  #define CYTHON_PROFILE 1
1602 #endif
1603 #endif
1604 #ifndef CYTHON_TRACE_NOGIL
1605  #define CYTHON_TRACE_NOGIL 0
1606 #else
1607  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1608  #define CYTHON_TRACE 1
1609  #endif
1610 #endif
1611 #ifndef CYTHON_TRACE
1612  #define CYTHON_TRACE 0
1613 #endif
1614 #if CYTHON_TRACE
1615  #undef CYTHON_PROFILE_REUSE_FRAME
1616 #endif
1617 #ifndef CYTHON_PROFILE_REUSE_FRAME
1618  #define CYTHON_PROFILE_REUSE_FRAME 0
1619 #endif
1620 #if CYTHON_PROFILE || CYTHON_TRACE
1621  #include "compile.h"
1622  #include "frameobject.h"
1623  #include "traceback.h"
1624  #if CYTHON_PROFILE_REUSE_FRAME
1625  #define CYTHON_FRAME_MODIFIER static
1626  #define CYTHON_FRAME_DEL(frame)
1627  #else
1628  #define CYTHON_FRAME_MODIFIER
1629  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1630  #endif
1631  #define __Pyx_TraceDeclarations\
1632  static PyCodeObject *__pyx_frame_code = NULL;\
1633  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1634  int __Pyx_use_tracing = 0;
1635  #define __Pyx_TraceFrameInit(codeobj)\
1636  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1637  #ifdef WITH_THREAD
1638  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1639  if (nogil) {\
1640  if (CYTHON_TRACE_NOGIL) {\
1641  PyThreadState *tstate;\
1642  PyGILState_STATE state = PyGILState_Ensure();\
1643  tstate = __Pyx_PyThreadState_Current;\
1644  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1645  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1646  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1647  }\
1648  PyGILState_Release(state);\
1649  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1650  }\
1651  } else {\
1652  PyThreadState* tstate = PyThreadState_GET();\
1653  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1654  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1655  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1656  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1657  }\
1658  }
1659  #else
1660  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1661  { PyThreadState* tstate = PyThreadState_GET();\
1662  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1663  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1664  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1665  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1666  }\
1667  }
1668  #endif
1669  #define __Pyx_TraceException()\
1670  if (likely(!__Pyx_use_tracing)); else {\
1671  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1672  if (tstate->use_tracing &&\
1673  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1674  tstate->tracing++;\
1675  tstate->use_tracing = 0;\
1676  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1677  if (exc_info) {\
1678  if (CYTHON_TRACE && tstate->c_tracefunc)\
1679  tstate->c_tracefunc(\
1680  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1681  tstate->c_profilefunc(\
1682  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1683  Py_DECREF(exc_info);\
1684  }\
1685  tstate->use_tracing = 1;\
1686  tstate->tracing--;\
1687  }\
1688  }
1689  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1690  PyObject *type, *value, *traceback;
1691  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1692  tstate->tracing++;
1693  tstate->use_tracing = 0;
1694  if (CYTHON_TRACE && tstate->c_tracefunc)
1695  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1696  if (tstate->c_profilefunc)
1697  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1698  CYTHON_FRAME_DEL(frame);
1699  tstate->use_tracing = 1;
1700  tstate->tracing--;
1701  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1702  }
1703  #ifdef WITH_THREAD
1704  #define __Pyx_TraceReturn(result, nogil)\
1705  if (likely(!__Pyx_use_tracing)); else {\
1706  if (nogil) {\
1707  if (CYTHON_TRACE_NOGIL) {\
1708  PyThreadState *tstate;\
1709  PyGILState_STATE state = PyGILState_Ensure();\
1710  tstate = __Pyx_PyThreadState_Current;\
1711  if (tstate->use_tracing) {\
1712  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1713  }\
1714  PyGILState_Release(state);\
1715  }\
1716  } else {\
1717  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1718  if (tstate->use_tracing) {\
1719  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1720  }\
1721  }\
1722  }
1723  #else
1724  #define __Pyx_TraceReturn(result, nogil)\
1725  if (likely(!__Pyx_use_tracing)); else {\
1726  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1727  if (tstate->use_tracing) {\
1728  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1729  }\
1730  }
1731  #endif
1732  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1733  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1734 #else
1735  #define __Pyx_TraceDeclarations
1736  #define __Pyx_TraceFrameInit(codeobj)
1737  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1738  #define __Pyx_TraceException()
1739  #define __Pyx_TraceReturn(result, nogil)
1740 #endif
1741 #if CYTHON_TRACE
1742  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1743  int ret;
1744  PyObject *type, *value, *traceback;
1745  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1746  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1747  tstate->tracing++;
1748  tstate->use_tracing = 0;
1749  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1750  tstate->use_tracing = 1;
1751  tstate->tracing--;
1752  if (likely(!ret)) {
1753  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1754  } else {
1755  Py_XDECREF(type);
1756  Py_XDECREF(value);
1757  Py_XDECREF(traceback);
1758  }
1759  return ret;
1760  }
1761  #ifdef WITH_THREAD
1762  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1763  if (likely(!__Pyx_use_tracing)); else {\
1764  if (nogil) {\
1765  if (CYTHON_TRACE_NOGIL) {\
1766  int ret = 0;\
1767  PyThreadState *tstate;\
1768  PyGILState_STATE state = PyGILState_Ensure();\
1769  tstate = __Pyx_PyThreadState_Current;\
1770  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1771  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1772  }\
1773  PyGILState_Release(state);\
1774  if (unlikely(ret)) goto_error;\
1775  }\
1776  } else {\
1777  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1778  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1779  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1780  if (unlikely(ret)) goto_error;\
1781  }\
1782  }\
1783  }
1784  #else
1785  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1786  if (likely(!__Pyx_use_tracing)); else {\
1787  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1788  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1789  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1790  if (unlikely(ret)) goto_error;\
1791  }\
1792  }
1793  #endif
1794 #else
1795  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1796 #endif
1797 
1798 /* GetItemInt.proto */
1799 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1800  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1801  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1802  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1803  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1804 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1805  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1806  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1807  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1808 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1809  int wraparound, int boundscheck);
1810 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1811  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1812  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1813  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1814 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1815  int wraparound, int boundscheck);
1816 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1817 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1818  int is_list, int wraparound, int boundscheck);
1819 
1820 /* ObjectGetItem.proto */
1821 #if CYTHON_USE_TYPE_SLOTS
1822 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1823 #else
1824 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1825 #endif
1826 
1827 /* MemviewSliceInit.proto */
1828 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1829 #define __Pyx_MEMVIEW_DIRECT 1
1830 #define __Pyx_MEMVIEW_PTR 2
1831 #define __Pyx_MEMVIEW_FULL 4
1832 #define __Pyx_MEMVIEW_CONTIG 8
1833 #define __Pyx_MEMVIEW_STRIDED 16
1834 #define __Pyx_MEMVIEW_FOLLOW 32
1835 #define __Pyx_IS_C_CONTIG 1
1836 #define __Pyx_IS_F_CONTIG 2
1837 static int __Pyx_init_memviewslice(
1838  struct __pyx_memoryview_obj *memview,
1839  int ndim,
1840  __Pyx_memviewslice *memviewslice,
1841  int memview_is_new_reference);
1842 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1843  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1844 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1845  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1846 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1847 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1848 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1849 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1850 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1851 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1852 
1853 /* Import.proto */
1854 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1855 
1856 /* ImportFrom.proto */
1857 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1858 
1859 /* PyFunctionFastCall.proto */
1860 #if CYTHON_FAST_PYCALL
1861 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1862  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1863 #if 1 || PY_VERSION_HEX < 0x030600B1
1864 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1865 #else
1866 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1867 #endif
1868 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1869  (sizeof(char [1 - 2*!(cond)]) - 1)
1870 #ifndef Py_MEMBER_SIZE
1871 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1872 #endif
1873  static size_t __pyx_pyframe_localsplus_offset = 0;
1874  #include "frameobject.h"
1875  #define __Pxy_PyFrame_Initialize_Offsets()\
1876  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1877  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1878  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1879  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1880 #endif
1881 
1882 /* PyObjectCall.proto */
1883 #if CYTHON_COMPILING_IN_CPYTHON
1884 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1885 #else
1886 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1887 #endif
1888 
1889 /* PyObjectCallMethO.proto */
1890 #if CYTHON_COMPILING_IN_CPYTHON
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1892 #endif
1893 
1894 /* PyObjectCallNoArg.proto */
1895 #if CYTHON_COMPILING_IN_CPYTHON
1896 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1897 #else
1898 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1899 #endif
1900 
1901 /* PyCFunctionFastCall.proto */
1902 #if CYTHON_FAST_PYCCALL
1903 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1904 #else
1905 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1906 #endif
1907 
1908 /* PyObjectCallOneArg.proto */
1909 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1910 
1911 /* PyErrExceptionMatches.proto */
1912 #if CYTHON_FAST_THREAD_STATE
1913 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1914 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1915 #else
1916 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1917 #endif
1918 
1919 /* GetAttr.proto */
1920 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1921 
1922 /* GetAttr3.proto */
1923 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1924 
1925 /* PyDictVersioning.proto */
1926 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1927 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1928 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1929 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1930  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1931  (cache_var) = (value);
1932 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1933  static PY_UINT64_T __pyx_dict_version = 0;\
1934  static PyObject *__pyx_dict_cached_value = NULL;\
1935  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1936  (VAR) = __pyx_dict_cached_value;\
1937  } else {\
1938  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1939  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1940  }\
1941 }
1942 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1943 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1944 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1945 #else
1946 #define __PYX_GET_DICT_VERSION(dict) (0)
1947 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1948 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1949 #endif
1950 
1951 /* GetModuleGlobalName.proto */
1952 #if CYTHON_USE_DICT_VERSIONS
1953 #define __Pyx_GetModuleGlobalName(var, name) {\
1954  static PY_UINT64_T __pyx_dict_version = 0;\
1955  static PyObject *__pyx_dict_cached_value = NULL;\
1956  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1957  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1958  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1959 }
1960 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1961  PY_UINT64_T __pyx_dict_version;\
1962  PyObject *__pyx_dict_cached_value;\
1963  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1964 }
1965 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1966 #else
1967 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1968 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1969 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1970 #endif
1971 
1972 /* KeywordStringCheck.proto */
1973 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1974 
1975 /* WriteUnraisableException.proto */
1976 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1977  int lineno, const char *filename,
1978  int full_traceback, int nogil);
1979 
1980 /* None.proto */
1981 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1982 
1983 /* FetchCommonType.proto */
1984 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1985 
1986 /* CythonFunctionShared.proto */
1987 #define __Pyx_CyFunction_USED 1
1988 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1989 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1990 #define __Pyx_CYFUNCTION_CCLASS 0x04
1991 #define __Pyx_CyFunction_GetClosure(f)\
1992  (((__pyx_CyFunctionObject *) (f))->func_closure)
1993 #define __Pyx_CyFunction_GetClassObj(f)\
1994  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1995 #define __Pyx_CyFunction_Defaults(type, f)\
1996  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1997 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1998  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1999 typedef struct {
2000  PyCFunctionObject func;
2001 #if PY_VERSION_HEX < 0x030500A0
2002  PyObject *func_weakreflist;
2003 #endif
2004  PyObject *func_dict;
2005  PyObject *func_name;
2006  PyObject *func_qualname;
2007  PyObject *func_doc;
2008  PyObject *func_globals;
2009  PyObject *func_code;
2010  PyObject *func_closure;
2011  PyObject *func_classobj;
2012  void *defaults;
2013  int defaults_pyobjects;
2014  size_t defaults_size; // used by FusedFunction for copying defaults
2015  int flags;
2016  PyObject *defaults_tuple;
2017  PyObject *defaults_kwdict;
2018  PyObject *(*defaults_getter)(PyObject *);
2019  PyObject *func_annotations;
2020 } __pyx_CyFunctionObject;
2021 static PyTypeObject *__pyx_CyFunctionType = 0;
2022 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2023 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2024  int flags, PyObject* qualname,
2025  PyObject *self,
2026  PyObject *module, PyObject *globals,
2027  PyObject* code);
2028 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2029  size_t size,
2030  int pyobjects);
2031 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2032  PyObject *tuple);
2033 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2034  PyObject *dict);
2035 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2036  PyObject *dict);
2037 static int __pyx_CyFunction_init(void);
2038 
2039 /* CythonFunction.proto */
2040 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2041  int flags, PyObject* qualname,
2042  PyObject *closure,
2043  PyObject *module, PyObject *globals,
2044  PyObject* code);
2045 
2046 /* PyObjectCall2Args.proto */
2047 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2048 
2049 /* SliceObject.proto */
2050 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2051  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2052  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2053  int has_cstart, int has_cstop, int wraparound);
2054 
2055 /* RaiseException.proto */
2056 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2057 
2058 /* HasAttr.proto */
2059 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2060 
2061 /* DictGetItem.proto */
2062 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2063 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2064 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2065  (likely(PyDict_CheckExact(obj)) ?\
2066  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2067 #else
2068 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2069 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2070 #endif
2071 
2072 /* RaiseTooManyValuesToUnpack.proto */
2073 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2074 
2075 /* RaiseNeedMoreValuesToUnpack.proto */
2076 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2077 
2078 /* RaiseNoneIterError.proto */
2079 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2080 
2081 /* ExtTypeTest.proto */
2082 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2083 
2084 /* GetTopmostException.proto */
2085 #if CYTHON_USE_EXC_INFO_STACK
2086 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2087 #endif
2088 
2089 /* SaveResetException.proto */
2090 #if CYTHON_FAST_THREAD_STATE
2091 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2092 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2093 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2094 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2095 #else
2096 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2097 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2098 #endif
2099 
2100 /* GetException.proto */
2101 #if CYTHON_FAST_THREAD_STATE
2102 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2103 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2104 #else
2105 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2106 #endif
2107 
2108 /* ArgTypeTest.proto */
2109 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2110  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2111  __Pyx__ArgTypeTest(obj, type, name, exact))
2112 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2113 
2114 /* IncludeStringH.proto */
2115 #include <string.h>
2116 
2117 /* BytesEquals.proto */
2118 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2119 
2120 /* UnicodeEquals.proto */
2121 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2122 
2123 /* StrEquals.proto */
2124 #if PY_MAJOR_VERSION >= 3
2125 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2126 #else
2127 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2128 #endif
2129 
2130 /* None.proto */
2131 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2132 
2133 /* UnaryNegOverflows.proto */
2134 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2135  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2136 
2137 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2138 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2139 /* decode_c_string_utf16.proto */
2140 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2141  int byteorder = 0;
2142  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2143 }
2144 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2145  int byteorder = -1;
2146  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2147 }
2148 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2149  int byteorder = 1;
2150  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2151 }
2152 
2153 /* decode_c_string.proto */
2154 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2155  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2156  const char* encoding, const char* errors,
2157  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2158 
2159 /* SwapException.proto */
2160 #if CYTHON_FAST_THREAD_STATE
2161 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2162 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2163 #else
2164 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2165 #endif
2166 
2167 /* FastTypeChecks.proto */
2168 #if CYTHON_COMPILING_IN_CPYTHON
2169 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2170 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2171 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2172 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2173 #else
2174 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2175 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2176 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2177 #endif
2178 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2179 
2180 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2181 /* ListCompAppend.proto */
2182 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2183 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2184  PyListObject* L = (PyListObject*) list;
2185  Py_ssize_t len = Py_SIZE(list);
2186  if (likely(L->allocated > len)) {
2187  Py_INCREF(x);
2188  PyList_SET_ITEM(list, len, x);
2189  __Pyx_SET_SIZE(list, len + 1);
2190  return 0;
2191  }
2192  return PyList_Append(list, x);
2193 }
2194 #else
2195 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2196 #endif
2197 
2198 /* PyIntBinop.proto */
2199 #if !CYTHON_COMPILING_IN_PYPY
2200 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2201 #else
2202 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2203  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2204 #endif
2205 
2206 /* ListExtend.proto */
2207 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2208 #if CYTHON_COMPILING_IN_CPYTHON
2209  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2210  if (unlikely(!none))
2211  return -1;
2212  Py_DECREF(none);
2213  return 0;
2214 #else
2215  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2216 #endif
2217 }
2218 
2219 /* ListAppend.proto */
2220 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2221 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2222  PyListObject* L = (PyListObject*) list;
2223  Py_ssize_t len = Py_SIZE(list);
2224  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2225  Py_INCREF(x);
2226  PyList_SET_ITEM(list, len, x);
2227  __Pyx_SET_SIZE(list, len + 1);
2228  return 0;
2229  }
2230  return PyList_Append(list, x);
2231 }
2232 #else
2233 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2234 #endif
2235 
2236 /* None.proto */
2237 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2238 
2239 /* None.proto */
2240 static CYTHON_INLINE long __Pyx_div_long(long, long);
2241 
2242 /* PyObject_GenericGetAttrNoDict.proto */
2243 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2244 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2245 #else
2246 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2247 #endif
2248 
2249 /* PyObject_GenericGetAttr.proto */
2250 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2251 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2252 #else
2253 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2254 #endif
2255 
2256 /* PyObjectGetAttrStrNoError.proto */
2257 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2258 
2259 /* SetupReduce.proto */
2260 static int __Pyx_setup_reduce(PyObject* type_obj);
2261 
2262 /* SetVTable.proto */
2263 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2264 
2265 /* TypeImport.proto */
2266 #ifndef __PYX_HAVE_RT_ImportType_proto
2267 #define __PYX_HAVE_RT_ImportType_proto
2268 enum __Pyx_ImportType_CheckSize {
2269  __Pyx_ImportType_CheckSize_Error = 0,
2270  __Pyx_ImportType_CheckSize_Warn = 1,
2271  __Pyx_ImportType_CheckSize_Ignore = 2
2272 };
2273 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2274 #endif
2275 
2276 /* CLineInTraceback.proto */
2277 #ifdef CYTHON_CLINE_IN_TRACEBACK
2278 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2279 #else
2280 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2281 #endif
2282 
2283 /* CodeObjectCache.proto */
2284 typedef struct {
2285  PyCodeObject* code_object;
2286  int code_line;
2287 } __Pyx_CodeObjectCacheEntry;
2288 struct __Pyx_CodeObjectCache {
2289  int count;
2290  int max_count;
2291  __Pyx_CodeObjectCacheEntry* entries;
2292 };
2293 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2294 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2295 static PyCodeObject *__pyx_find_code_object(int code_line);
2296 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2297 
2298 /* AddTraceback.proto */
2299 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2300  int py_line, const char *filename);
2301 
2302 #if PY_MAJOR_VERSION < 3
2303  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2304  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2305 #else
2306  #define __Pyx_GetBuffer PyObject_GetBuffer
2307  #define __Pyx_ReleaseBuffer PyBuffer_Release
2308 #endif
2309 
2310 
2311 /* BufferStructDeclare.proto */
2312 typedef struct {
2313  Py_ssize_t shape, strides, suboffsets;
2314 } __Pyx_Buf_DimInfo;
2315 typedef struct {
2316  size_t refcount;
2317  Py_buffer pybuffer;
2318 } __Pyx_Buffer;
2319 typedef struct {
2320  __Pyx_Buffer *rcbuffer;
2321  char *data;
2322  __Pyx_Buf_DimInfo diminfo[8];
2323 } __Pyx_LocalBuf_ND;
2324 
2325 /* MemviewSliceIsContig.proto */
2326 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2327 
2328 /* OverlappingSlices.proto */
2329 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2330  __Pyx_memviewslice *slice2,
2331  int ndim, size_t itemsize);
2332 
2333 /* Capsule.proto */
2334 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2335 
2336 /* MemviewDtypeToObject.proto */
2337 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2338 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2339 
2340 /* IsLittleEndian.proto */
2341 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2342 
2343 /* BufferFormatCheck.proto */
2344 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2345 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2346  __Pyx_BufFmt_StackElem* stack,
2347  __Pyx_TypeInfo* type);
2348 
2349 /* TypeInfoCompare.proto */
2350 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2351 
2352 /* MemviewSliceValidateAndInit.proto */
2353 static int __Pyx_ValidateAndInit_memviewslice(
2354  int *axes_specs,
2355  int c_or_f_flag,
2356  int buf_flags,
2357  int ndim,
2358  __Pyx_TypeInfo *dtype,
2359  __Pyx_BufFmt_StackElem stack[],
2360  __Pyx_memviewslice *memviewslice,
2361  PyObject *original_obj);
2362 
2363 /* ObjectToMemviewSlice.proto */
2364 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2365 
2366 /* CIntToPy.proto */
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2368 
2369 /* CIntToPy.proto */
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2371 
2372 /* RealImag.proto */
2373 #if CYTHON_CCOMPLEX
2374  #ifdef __cplusplus
2375  #define __Pyx_CREAL(z) ((z).real())
2376  #define __Pyx_CIMAG(z) ((z).imag())
2377  #else
2378  #define __Pyx_CREAL(z) (__real__(z))
2379  #define __Pyx_CIMAG(z) (__imag__(z))
2380  #endif
2381 #else
2382  #define __Pyx_CREAL(z) ((z).real)
2383  #define __Pyx_CIMAG(z) ((z).imag)
2384 #endif
2385 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2386  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2387  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2388  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2389 #else
2390  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2391  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2392 #endif
2393 
2394 /* Arithmetic.proto */
2395 #if CYTHON_CCOMPLEX
2396  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2397  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2398  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2399  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2400  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2401  #define __Pyx_c_neg_float(a) (-(a))
2402  #ifdef __cplusplus
2403  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2404  #define __Pyx_c_conj_float(z) (::std::conj(z))
2405  #if 1
2406  #define __Pyx_c_abs_float(z) (::std::abs(z))
2407  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2408  #endif
2409  #else
2410  #define __Pyx_c_is_zero_float(z) ((z)==0)
2411  #define __Pyx_c_conj_float(z) (conjf(z))
2412  #if 1
2413  #define __Pyx_c_abs_float(z) (cabsf(z))
2414  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2415  #endif
2416  #endif
2417 #else
2418  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2419  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2420  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2421  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2422  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2423  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2424  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2425  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2426  #if 1
2427  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2428  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2429  #endif
2430 #endif
2431 
2432 /* Arithmetic.proto */
2433 #if CYTHON_CCOMPLEX
2434  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2435  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2436  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2437  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2438  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2439  #define __Pyx_c_neg_double(a) (-(a))
2440  #ifdef __cplusplus
2441  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2442  #define __Pyx_c_conj_double(z) (::std::conj(z))
2443  #if 1
2444  #define __Pyx_c_abs_double(z) (::std::abs(z))
2445  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2446  #endif
2447  #else
2448  #define __Pyx_c_is_zero_double(z) ((z)==0)
2449  #define __Pyx_c_conj_double(z) (conj(z))
2450  #if 1
2451  #define __Pyx_c_abs_double(z) (cabs(z))
2452  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2453  #endif
2454  #endif
2455 #else
2456  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2457  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2458  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2459  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2460  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2461  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2462  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2463  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2464  #if 1
2465  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2466  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2467  #endif
2468 #endif
2469 
2470 /* CIntToPy.proto */
2471 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2472 
2473 /* MemviewSliceCopyTemplate.proto */
2474 static __Pyx_memviewslice
2475 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2476  const char *mode, int ndim,
2477  size_t sizeof_dtype, int contig_flag,
2478  int dtype_is_object);
2479 
2480 /* CIntFromPy.proto */
2481 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2482 
2483 /* CIntFromPy.proto */
2484 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2485 
2486 /* CIntFromPy.proto */
2487 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2488 
2489 /* CheckBinaryVersion.proto */
2490 static int __Pyx_check_binary_version(void);
2491 
2492 /* InitStrings.proto */
2493 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2494 
2495 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2496 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2497 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2498 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2499 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2500 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2501 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2502 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2503 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2504 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2505 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2506 
2507 /* Module declarations from 'cython.view' */
2508 
2509 /* Module declarations from 'cython' */
2510 
2511 /* Module declarations from 'cpython.buffer' */
2512 
2513 /* Module declarations from 'libc.string' */
2514 
2515 /* Module declarations from 'libc.stdio' */
2516 
2517 /* Module declarations from '__builtin__' */
2518 
2519 /* Module declarations from 'cpython.type' */
2520 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2521 
2522 /* Module declarations from 'cpython' */
2523 
2524 /* Module declarations from 'cpython.object' */
2525 
2526 /* Module declarations from 'cpython.ref' */
2527 
2528 /* Module declarations from 'cpython.mem' */
2529 
2530 /* Module declarations from 'numpy' */
2531 
2532 /* Module declarations from 'numpy' */
2533 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2534 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2535 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2536 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2537 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2538 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2539 
2540 /* Module declarations from 'BoundaryConditions' */
2541 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2542 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2543 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2544 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2545 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2546 static PyTypeObject *__pyx_array_type = 0;
2547 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2548 static PyTypeObject *__pyx_memoryview_type = 0;
2549 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2550 static PyObject *generic = 0;
2551 static PyObject *strided = 0;
2552 static PyObject *indirect = 0;
2553 static PyObject *contiguous = 0;
2554 static PyObject *indirect_contiguous = 0;
2555 static int __pyx_memoryview_thread_locks_used;
2556 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2557 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2558 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2559 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2560 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2561 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2562 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2563 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2564 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2565 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2566 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2567 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2568 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2569 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2570 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2571 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2572 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2573 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2574 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2575 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2576 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2577 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2578 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2579 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2580 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2581 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2582 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2583 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2584 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2585 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2586 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2587 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2588 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2589 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2590 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2591 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2592 #define __Pyx_MODULE_NAME "BoundaryConditions"
2593 extern int __pyx_module_is_main_BoundaryConditions;
2594 int __pyx_module_is_main_BoundaryConditions = 0;
2595 
2596 /* Implementation of 'BoundaryConditions' */
2597 static PyObject *__pyx_builtin_sum;
2598 static PyObject *__pyx_builtin_TypeError;
2599 static PyObject *__pyx_builtin_RuntimeError;
2600 static PyObject *__pyx_builtin_ValueError;
2601 static PyObject *__pyx_builtin_ImportError;
2602 static PyObject *__pyx_builtin_MemoryError;
2603 static PyObject *__pyx_builtin_enumerate;
2604 static PyObject *__pyx_builtin_range;
2605 static PyObject *__pyx_builtin_Ellipsis;
2606 static PyObject *__pyx_builtin_id;
2607 static PyObject *__pyx_builtin_IndexError;
2608 static const char __pyx_k_O[] = "O";
2609 static const char __pyx_k_a[] = "a";
2610 static const char __pyx_k_c[] = "c";
2611 static const char __pyx_k_n[] = "n";
2612 static const char __pyx_k_t[] = "t";
2613 static const char __pyx_k_x[] = "x";
2614 static const char __pyx_k_a0[] = "a0";
2615 static const char __pyx_k_id[] = "id";
2616 static const char __pyx_k_nd[] = "nd";
2617 static const char __pyx_k_np[] = "np";
2618 static const char __pyx_k_t1[] = "t1";
2619 static const char __pyx_k_all[] = "__all__";
2620 static const char __pyx_k_b_i[] = "b_i";
2621 static const char __pyx_k_get[] = "get";
2622 static const char __pyx_k_new[] = "__new__";
2623 static const char __pyx_k_obj[] = "obj";
2624 static const char __pyx_k_sum[] = "sum";
2625 static const char __pyx_k_None[] = "None";
2626 static const char __pyx_k_b_or[] = "b_or";
2627 static const char __pyx_k_base[] = "base";
2628 static const char __pyx_k_dict[] = "__dict__";
2629 static const char __pyx_k_main[] = "__main__";
2630 static const char __pyx_k_mode[] = "mode";
2631 static const char __pyx_k_name[] = "name";
2632 static const char __pyx_k_ndim[] = "ndim";
2633 static const char __pyx_k_pack[] = "pack";
2634 static const char __pyx_k_self[] = "self";
2635 static const char __pyx_k_size[] = "size";
2636 static const char __pyx_k_step[] = "step";
2637 static const char __pyx_k_stop[] = "stop";
2638 static const char __pyx_k_test[] = "__test__";
2639 static const char __pyx_k_ASCII[] = "ASCII";
2640 static const char __pyx_k_class[] = "__class__";
2641 static const char __pyx_k_error[] = "error";
2642 static const char __pyx_k_flags[] = "flags";
2643 static const char __pyx_k_numpy[] = "numpy";
2644 static const char __pyx_k_range[] = "range";
2645 static const char __pyx_k_shape[] = "shape";
2646 static const char __pyx_k_start[] = "start";
2647 static const char __pyx_k_state[] = "state";
2648 static const char __pyx_k_value[] = "value";
2649 static const char __pyx_k_zeros[] = "zeros";
2650 static const char __pyx_k_Domain[] = "Domain";
2651 static const char __pyx_k_dict_2[] = "_dict";
2652 static const char __pyx_k_encode[] = "encode";
2653 static const char __pyx_k_format[] = "format";
2654 static const char __pyx_k_import[] = "__import__";
2655 static const char __pyx_k_name_2[] = "__name__";
2656 static const char __pyx_k_pickle[] = "pickle";
2657 static const char __pyx_k_reduce[] = "__reduce__";
2658 static const char __pyx_k_struct[] = "struct";
2659 static const char __pyx_k_unpack[] = "unpack";
2660 static const char __pyx_k_update[] = "update";
2661 static const char __pyx_k_BC_Base[] = "BC_Base";
2662 static const char __pyx_k_Context[] = "Context";
2663 static const char __pyx_k_context[] = "context";
2664 static const char __pyx_k_fortran[] = "fortran";
2665 static const char __pyx_k_memview[] = "memview";
2666 static const char __pyx_k_proteus[] = "proteus";
2667 static const char __pyx_k_resetBC[] = "resetBC";
2668 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2669 static const char __pyx_k_getstate[] = "__getstate__";
2670 static const char __pyx_k_itemsize[] = "itemsize";
2671 static const char __pyx_k_pyx_type[] = "__pyx_type";
2672 static const char __pyx_k_setstate[] = "__setstate__";
2673 static const char __pyx_k_TypeError[] = "TypeError";
2674 static const char __pyx_k_enumerate[] = "enumerate";
2675 static const char __pyx_k_pyx_state[] = "__pyx_state";
2676 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2677 static const char __pyx_k_IndexError[] = "IndexError";
2678 static const char __pyx_k_ValueError[] = "ValueError";
2679 static const char __pyx_k_getContext[] = "getContext";
2680 static const char __pyx_k_pyx_result[] = "__pyx_result";
2681 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2682 static const char __pyx_k_ImportError[] = "ImportError";
2683 static const char __pyx_k_MemoryError[] = "MemoryError";
2684 static const char __pyx_k_PickleError[] = "PickleError";
2685 static const char __pyx_k_init_cython[] = "init_cython";
2686 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2687 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2688 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2689 static const char __pyx_k_stringsource[] = "stringsource";
2690 static const char __pyx_k_use_setstate[] = "use_setstate";
2691 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2692 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2693 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2694 static const char __pyx_k_setLinearRamp[] = "setLinearRamp";
2695 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2696 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2697 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2698 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2699 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2700 static const char __pyx_k_BoundaryCondition[] = "BoundaryCondition";
2701 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2702 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2703 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2704 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2705 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2706 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2707 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2708 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2709 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2710 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2711 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2712 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2713 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2714 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2715 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2716 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2717 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2718 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2719 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2720 static const char __pyx_k_setLinearRamp_locals_lambda[] = "setLinearRamp.<locals>.<lambda>";
2721 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2722 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2723 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2724 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2725 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2726 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2727 static const char __pyx_k_BoundaryCondition_setLinearRamp[] = "BoundaryCondition.setLinearRamp";
2728 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2729 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2730 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2731 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2732 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2733 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2734 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2735 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2736 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2737 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2738 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2739 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] = "Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2740 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2741 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2742 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2743 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2744 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2745 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2746 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2747 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2748 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2749 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2750 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2751 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2752 static PyObject *__pyx_n_s_ASCII;
2753 static PyObject *__pyx_n_s_BC_Base;
2754 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2755 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2756 static PyObject *__pyx_n_s_BC_Base_getContext;
2757 static PyObject *__pyx_n_s_BoundaryCondition;
2758 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2759 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2760 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2761 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2762 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2763 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2764 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2765 static PyObject *__pyx_n_s_BoundaryConditions;
2766 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2767 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2768 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2769 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2770 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2771 static PyObject *__pyx_n_s_Context;
2772 static PyObject *__pyx_n_s_Domain;
2773 static PyObject *__pyx_n_s_Ellipsis;
2774 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2775 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2776 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2777 static PyObject *__pyx_n_s_ImportError;
2778 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2779 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2780 static PyObject *__pyx_n_s_IndexError;
2781 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2782 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2783 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2784 static PyObject *__pyx_n_s_MemoryError;
2785 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2786 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2787 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2788 static PyObject *__pyx_n_s_None;
2789 static PyObject *__pyx_n_b_O;
2790 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2791 static PyObject *__pyx_n_s_PickleError;
2792 static PyObject *__pyx_n_s_RuntimeError;
2793 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2794 static PyObject *__pyx_n_s_TypeError;
2795 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2796 static PyObject *__pyx_n_s_ValueError;
2797 static PyObject *__pyx_n_s_View_MemoryView;
2798 static PyObject *__pyx_n_s_a;
2799 static PyObject *__pyx_n_s_a0;
2800 static PyObject *__pyx_n_s_all;
2801 static PyObject *__pyx_n_s_allocate_buffer;
2802 static PyObject *__pyx_n_s_b_i;
2803 static PyObject *__pyx_n_s_b_or;
2804 static PyObject *__pyx_n_s_base;
2805 static PyObject *__pyx_n_s_c;
2806 static PyObject *__pyx_n_u_c;
2807 static PyObject *__pyx_n_s_class;
2808 static PyObject *__pyx_n_s_cline_in_traceback;
2809 static PyObject *__pyx_n_s_context;
2810 static PyObject *__pyx_kp_s_contiguous_and_direct;
2811 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2812 static PyObject *__pyx_n_s_dict;
2813 static PyObject *__pyx_n_s_dict_2;
2814 static PyObject *__pyx_n_s_dtype_is_object;
2815 static PyObject *__pyx_n_s_encode;
2816 static PyObject *__pyx_n_s_enumerate;
2817 static PyObject *__pyx_n_s_error;
2818 static PyObject *__pyx_n_s_flags;
2819 static PyObject *__pyx_n_s_format;
2820 static PyObject *__pyx_n_s_fortran;
2821 static PyObject *__pyx_n_u_fortran;
2822 static PyObject *__pyx_n_s_get;
2823 static PyObject *__pyx_n_s_getContext;
2824 static PyObject *__pyx_n_s_getstate;
2825 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2826 static PyObject *__pyx_n_s_id;
2827 static PyObject *__pyx_n_s_import;
2828 static PyObject *__pyx_n_s_init_cython;
2829 static PyObject *__pyx_n_s_itemsize;
2830 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2831 static PyObject *__pyx_n_s_main;
2832 static PyObject *__pyx_n_s_memview;
2833 static PyObject *__pyx_n_s_mode;
2834 static PyObject *__pyx_n_s_n;
2835 static PyObject *__pyx_n_s_name;
2836 static PyObject *__pyx_n_s_name_2;
2837 static PyObject *__pyx_n_s_nd;
2838 static PyObject *__pyx_n_s_ndim;
2839 static PyObject *__pyx_n_s_new;
2840 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2841 static PyObject *__pyx_n_s_np;
2842 static PyObject *__pyx_n_s_numpy;
2843 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2844 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2845 static PyObject *__pyx_n_s_obj;
2846 static PyObject *__pyx_n_s_pack;
2847 static PyObject *__pyx_n_s_pickle;
2848 static PyObject *__pyx_n_s_proteus;
2849 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2850 static PyObject *__pyx_n_s_pyx_PickleError;
2851 static PyObject *__pyx_n_s_pyx_checksum;
2852 static PyObject *__pyx_n_s_pyx_getbuffer;
2853 static PyObject *__pyx_n_s_pyx_result;
2854 static PyObject *__pyx_n_s_pyx_state;
2855 static PyObject *__pyx_n_s_pyx_type;
2856 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2857 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2858 static PyObject *__pyx_n_s_pyx_vtable;
2859 static PyObject *__pyx_n_s_range;
2860 static PyObject *__pyx_n_s_reduce;
2861 static PyObject *__pyx_n_s_reduce_cython;
2862 static PyObject *__pyx_n_s_reduce_ex;
2863 static PyObject *__pyx_n_s_resetBC;
2864 static PyObject *__pyx_n_s_self;
2865 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2866 static PyObject *__pyx_n_s_setConstantBC;
2867 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2868 static PyObject *__pyx_n_s_setLinearBC;
2869 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2870 static PyObject *__pyx_n_s_setLinearRamp;
2871 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2872 static PyObject *__pyx_n_s_setstate;
2873 static PyObject *__pyx_n_s_setstate_cython;
2874 static PyObject *__pyx_n_s_shape;
2875 static PyObject *__pyx_n_s_size;
2876 static PyObject *__pyx_n_s_start;
2877 static PyObject *__pyx_n_s_state;
2878 static PyObject *__pyx_n_s_step;
2879 static PyObject *__pyx_n_s_stop;
2880 static PyObject *__pyx_kp_s_strided_and_direct;
2881 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2882 static PyObject *__pyx_kp_s_strided_and_indirect;
2883 static PyObject *__pyx_kp_s_stringsource;
2884 static PyObject *__pyx_n_s_struct;
2885 static PyObject *__pyx_n_s_sum;
2886 static PyObject *__pyx_n_s_t;
2887 static PyObject *__pyx_n_s_t1;
2888 static PyObject *__pyx_n_s_test;
2889 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2890 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2891 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2892 static PyObject *__pyx_n_s_unpack;
2893 static PyObject *__pyx_n_s_update;
2894 static PyObject *__pyx_n_s_use_setstate;
2895 static PyObject *__pyx_n_s_value;
2896 static PyObject *__pyx_n_s_x;
2897 static PyObject *__pyx_n_s_zeros;
2898 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
2899 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
2900 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2901 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2902 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2903 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2904 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2905 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2906 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2907 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2908 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2909 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2910 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2911 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2912 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2913 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2914 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2915 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2916 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2917 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2918 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2919 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2920 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2921 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2922 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2923 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2924 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a); /* proto */
2925 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2926 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2927 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value); /* proto */
2928 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2929 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2930 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2932 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2933 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2934 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2935 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2936 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2938 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2939 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2940 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2941 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2942 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2944 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2945 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2946 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2947 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2948 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2949 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2950 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2951 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2952 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2953 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2954 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2955 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2956 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2957 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2958 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2959 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2960 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2961 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2962 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2963 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2964 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2965 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2966 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2967 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2968 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2969 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2970 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2971 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2973 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2974 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2975 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2976 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2977 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2978 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2979 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2980 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2981 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2982 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2983 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2984 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2985 static PyObject *__pyx_int_0;
2986 static PyObject *__pyx_int_1;
2987 static PyObject *__pyx_int_3;
2988 static PyObject *__pyx_int_158231071;
2989 static PyObject *__pyx_int_184977713;
2990 static PyObject *__pyx_int_neg_1;
2991 static PyObject *__pyx_codeobj_;
2992 static PyObject *__pyx_slice__7;
2993 static PyObject *__pyx_tuple__11;
2994 static PyObject *__pyx_tuple__13;
2995 static PyObject *__pyx_tuple__15;
2996 static PyObject *__pyx_tuple__16;
2997 static PyObject *__pyx_tuple__17;
2998 static PyObject *__pyx_tuple__18;
2999 static PyObject *__pyx_tuple__19;
3000 static PyObject *__pyx_tuple__20;
3001 static PyObject *__pyx_tuple__21;
3002 static PyObject *__pyx_tuple__22;
3003 static PyObject *__pyx_tuple__23;
3004 static PyObject *__pyx_tuple__24;
3005 static PyObject *__pyx_tuple__25;
3006 static PyObject *__pyx_tuple__26;
3007 static PyObject *__pyx_tuple__27;
3008 static PyObject *__pyx_tuple__28;
3009 static PyObject *__pyx_tuple__29;
3010 static PyObject *__pyx_tuple__30;
3011 static PyObject *__pyx_tuple__31;
3012 static PyObject *__pyx_tuple__32;
3013 static PyObject *__pyx_tuple__33;
3014 static PyObject *__pyx_tuple__34;
3015 static PyObject *__pyx_tuple__35;
3016 static PyObject *__pyx_tuple__36;
3017 static PyObject *__pyx_tuple__38;
3018 static PyObject *__pyx_tuple__39;
3019 static PyObject *__pyx_tuple__40;
3020 static PyObject *__pyx_tuple__41;
3021 static PyObject *__pyx_tuple__42;
3022 static PyObject *__pyx_tuple__43;
3023 static PyObject *__pyx_tuple__44;
3024 static PyObject *__pyx_tuple__45;
3025 static PyObject *__pyx_tuple__46;
3026 static PyObject *__pyx_tuple__47;
3027 static PyObject *__pyx_tuple__48;
3028 static PyObject *__pyx_tuple__49;
3029 static PyObject *__pyx_tuple__50;
3030 static PyObject *__pyx_tuple__51;
3031 static PyObject *__pyx_tuple__52;
3032 static PyObject *__pyx_tuple__53;
3033 static PyObject *__pyx_tuple__54;
3034 static PyObject *__pyx_codeobj__2;
3035 static PyObject *__pyx_codeobj__3;
3036 static PyObject *__pyx_codeobj__4;
3037 static PyObject *__pyx_codeobj__5;
3038 static PyObject *__pyx_codeobj__6;
3039 static PyObject *__pyx_codeobj__8;
3040 static PyObject *__pyx_codeobj__9;
3041 static PyObject *__pyx_codeobj__10;
3042 static PyObject *__pyx_codeobj__12;
3043 static PyObject *__pyx_codeobj__14;
3044 static PyObject *__pyx_codeobj__37;
3045 /* Late includes */
3046 
3047 /* "BoundaryConditions.py":24
3048  * Generic class regrouping boundary conditions
3049  * """
3050  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3051  * self.Shape = shape
3052  * self.name = name
3053  */
3054 
3055 /* Python wrapper */
3056 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3057 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3058  PyObject *__pyx_v_shape = 0;
3059  PyObject *__pyx_v_name = 0;
3060  PyObject *__pyx_v_b_or = 0;
3061  PyObject *__pyx_v_b_i = 0;
3062  PyObject *__pyx_v_nd = 0;
3063  int __pyx_lineno = 0;
3064  const char *__pyx_filename = NULL;
3065  int __pyx_clineno = 0;
3066  int __pyx_r;
3067  __Pyx_RefNannyDeclarations
3068  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3069  {
3070  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3071  PyObject* values[5] = {0,0,0,0,0};
3072  values[0] = ((PyObject *)Py_None);
3073  values[1] = ((PyObject *)Py_None);
3074  values[2] = ((PyObject *)Py_None);
3075  values[3] = ((PyObject *)__pyx_int_0);
3076  values[4] = ((PyObject *)Py_None);
3077  if (unlikely(__pyx_kwds)) {
3078  Py_ssize_t kw_args;
3079  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3080  switch (pos_args) {
3081  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3082  CYTHON_FALLTHROUGH;
3083  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3084  CYTHON_FALLTHROUGH;
3085  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3086  CYTHON_FALLTHROUGH;
3087  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3088  CYTHON_FALLTHROUGH;
3089  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3090  CYTHON_FALLTHROUGH;
3091  case 0: break;
3092  default: goto __pyx_L5_argtuple_error;
3093  }
3094  kw_args = PyDict_Size(__pyx_kwds);
3095  switch (pos_args) {
3096  case 0:
3097  if (kw_args > 0) {
3098  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3099  if (value) { values[0] = value; kw_args--; }
3100  }
3101  CYTHON_FALLTHROUGH;
3102  case 1:
3103  if (kw_args > 0) {
3104  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3105  if (value) { values[1] = value; kw_args--; }
3106  }
3107  CYTHON_FALLTHROUGH;
3108  case 2:
3109  if (kw_args > 0) {
3110  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3111  if (value) { values[2] = value; kw_args--; }
3112  }
3113  CYTHON_FALLTHROUGH;
3114  case 3:
3115  if (kw_args > 0) {
3116  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3117  if (value) { values[3] = value; kw_args--; }
3118  }
3119  CYTHON_FALLTHROUGH;
3120  case 4:
3121  if (kw_args > 0) {
3122  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3123  if (value) { values[4] = value; kw_args--; }
3124  }
3125  }
3126  if (unlikely(kw_args > 0)) {
3127  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3128  }
3129  } else {
3130  switch (PyTuple_GET_SIZE(__pyx_args)) {
3131  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3132  CYTHON_FALLTHROUGH;
3133  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3134  CYTHON_FALLTHROUGH;
3135  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3136  CYTHON_FALLTHROUGH;
3137  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3138  CYTHON_FALLTHROUGH;
3139  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3140  CYTHON_FALLTHROUGH;
3141  case 0: break;
3142  default: goto __pyx_L5_argtuple_error;
3143  }
3144  }
3145  __pyx_v_shape = values[0];
3146  __pyx_v_name = values[1];
3147  __pyx_v_b_or = values[2];
3148  __pyx_v_b_i = values[3];
3149  __pyx_v_nd = values[4];
3150  }
3151  goto __pyx_L4_argument_unpacking_done;
3152  __pyx_L5_argtuple_error:;
3153  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3154  __pyx_L3_error:;
3155  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3156  __Pyx_RefNannyFinishContext();
3157  return -1;
3158  __pyx_L4_argument_unpacking_done:;
3159  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3160 
3161  /* function exit code */
3162  __Pyx_RefNannyFinishContext();
3163  return __pyx_r;
3164 }
3165 
3166 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3167  int __pyx_r;
3168  __Pyx_TraceDeclarations
3169  __Pyx_RefNannyDeclarations
3170  PyObject *__pyx_t_1 = NULL;
3171  int __pyx_t_2;
3172  int __pyx_t_3;
3173  PyObject *__pyx_t_4 = NULL;
3174  int __pyx_t_5;
3175  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3176  int __pyx_lineno = 0;
3177  const char *__pyx_filename = NULL;
3178  int __pyx_clineno = 0;
3179  __Pyx_RefNannySetupContext("__init__", 0);
3180  __Pyx_TraceCall("__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3181 
3182  /* "BoundaryConditions.py":25
3183  * """
3184  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3185  * self.Shape = shape # <<<<<<<<<<<<<<
3186  * self.name = name
3187  * self.BC_type = 'None'
3188  */
3189  __Pyx_INCREF(__pyx_v_shape);
3190  __Pyx_GIVEREF(__pyx_v_shape);
3191  __Pyx_GOTREF(__pyx_v_self->Shape);
3192  __Pyx_DECREF(__pyx_v_self->Shape);
3193  __pyx_v_self->Shape = __pyx_v_shape;
3194 
3195  /* "BoundaryConditions.py":26
3196  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3197  * self.Shape = shape
3198  * self.name = name # <<<<<<<<<<<<<<
3199  * self.BC_type = 'None'
3200  * if shape is not None:
3201  */
3202  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3203  __pyx_t_1 = __pyx_v_name;
3204  __Pyx_INCREF(__pyx_t_1);
3205  __Pyx_GIVEREF(__pyx_t_1);
3206  __Pyx_GOTREF(__pyx_v_self->name);
3207  __Pyx_DECREF(__pyx_v_self->name);
3208  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3209  __pyx_t_1 = 0;
3210 
3211  /* "BoundaryConditions.py":27
3212  * self.Shape = shape
3213  * self.name = name
3214  * self.BC_type = 'None' # <<<<<<<<<<<<<<
3215  * if shape is not None:
3216  * self.nd = self.Shape.Domain.nd
3217  */
3218  __Pyx_INCREF(__pyx_n_s_None);
3219  __Pyx_GIVEREF(__pyx_n_s_None);
3220  __Pyx_GOTREF(__pyx_v_self->BC_type);
3221  __Pyx_DECREF(__pyx_v_self->BC_type);
3222  __pyx_v_self->BC_type = __pyx_n_s_None;
3223 
3224  /* "BoundaryConditions.py":28
3225  * self.name = name
3226  * self.BC_type = 'None'
3227  * if shape is not None: # <<<<<<<<<<<<<<
3228  * self.nd = self.Shape.Domain.nd
3229  * elif nd is not None:
3230  */
3231  __pyx_t_2 = (__pyx_v_shape != Py_None);
3232  __pyx_t_3 = (__pyx_t_2 != 0);
3233  if (__pyx_t_3) {
3234 
3235  /* "BoundaryConditions.py":29
3236  * self.BC_type = 'None'
3237  * if shape is not None:
3238  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
3239  * elif nd is not None:
3240  * self.nd = nd
3241  */
3242  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3243  __Pyx_GOTREF(__pyx_t_1);
3244  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3245  __Pyx_GOTREF(__pyx_t_4);
3246  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3247  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3248  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3249  __pyx_v_self->nd = __pyx_t_5;
3250 
3251  /* "BoundaryConditions.py":28
3252  * self.name = name
3253  * self.BC_type = 'None'
3254  * if shape is not None: # <<<<<<<<<<<<<<
3255  * self.nd = self.Shape.Domain.nd
3256  * elif nd is not None:
3257  */
3258  goto __pyx_L3;
3259  }
3260 
3261  /* "BoundaryConditions.py":30
3262  * if shape is not None:
3263  * self.nd = self.Shape.Domain.nd
3264  * elif nd is not None: # <<<<<<<<<<<<<<
3265  * self.nd = nd
3266  * else:
3267  */
3268  __pyx_t_3 = (__pyx_v_nd != Py_None);
3269  __pyx_t_2 = (__pyx_t_3 != 0);
3270  if (__pyx_t_2) {
3271 
3272  /* "BoundaryConditions.py":31
3273  * self.nd = self.Shape.Domain.nd
3274  * elif nd is not None:
3275  * self.nd = nd # <<<<<<<<<<<<<<
3276  * else:
3277  * assert nd is not None, 'Shape or nd must be passed to BC'
3278  */
3279  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3280  __pyx_v_self->nd = __pyx_t_5;
3281 
3282  /* "BoundaryConditions.py":30
3283  * if shape is not None:
3284  * self.nd = self.Shape.Domain.nd
3285  * elif nd is not None: # <<<<<<<<<<<<<<
3286  * self.nd = nd
3287  * else:
3288  */
3289  goto __pyx_L3;
3290  }
3291 
3292  /* "BoundaryConditions.py":33
3293  * self.nd = nd
3294  * else:
3295  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
3296  * if b_or is not None:
3297  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3298  */
3299  /*else*/ {
3300  #ifndef CYTHON_WITHOUT_ASSERTIONS
3301  if (unlikely(!Py_OptimizeFlag)) {
3302  __pyx_t_2 = (__pyx_v_nd != Py_None);
3303  if (unlikely(!(__pyx_t_2 != 0))) {
3304  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3305  __PYX_ERR(0, 33, __pyx_L1_error)
3306  }
3307  }
3308  #endif
3309  }
3310  __pyx_L3:;
3311 
3312  /* "BoundaryConditions.py":34
3313  * else:
3314  * assert nd is not None, 'Shape or nd must be passed to BC'
3315  * if b_or is not None: # <<<<<<<<<<<<<<
3316  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3317  * else:
3318  */
3319  __pyx_t_2 = (__pyx_v_b_or != Py_None);
3320  __pyx_t_3 = (__pyx_t_2 != 0);
3321  if (__pyx_t_3) {
3322 
3323  /* "BoundaryConditions.py":35
3324  * assert nd is not None, 'Shape or nd must be passed to BC'
3325  * if b_or is not None:
3326  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
3327  * else:
3328  * self._b_or = None
3329  */
3330  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3331  __Pyx_GOTREF(__pyx_t_4);
3332  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3333  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3334  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3335  __pyx_v_self->_b_or = __pyx_t_6;
3336  __pyx_t_6.memview = NULL;
3337  __pyx_t_6.data = NULL;
3338 
3339  /* "BoundaryConditions.py":34
3340  * else:
3341  * assert nd is not None, 'Shape or nd must be passed to BC'
3342  * if b_or is not None: # <<<<<<<<<<<<<<
3343  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3344  * else:
3345  */
3346  goto __pyx_L4;
3347  }
3348 
3349  /* "BoundaryConditions.py":37
3350  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3351  * else:
3352  * self._b_or = None # <<<<<<<<<<<<<<
3353  *
3354  * # @staticmethod
3355  */
3356  /*else*/ {
3357  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3358  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3359  __pyx_v_self->_b_or = __pyx_t_6;
3360  __pyx_t_6.memview = NULL;
3361  __pyx_t_6.data = NULL;
3362  }
3363  __pyx_L4:;
3364 
3365  /* "BoundaryConditions.py":24
3366  * Generic class regrouping boundary conditions
3367  * """
3368  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3369  * self.Shape = shape
3370  * self.name = name
3371  */
3372 
3373  /* function exit code */
3374  __pyx_r = 0;
3375  goto __pyx_L0;
3376  __pyx_L1_error:;
3377  __Pyx_XDECREF(__pyx_t_1);
3378  __Pyx_XDECREF(__pyx_t_4);
3379  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3380  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3381  __pyx_r = -1;
3382  __pyx_L0:;
3383  __Pyx_TraceReturn(Py_None, 0);
3384  __Pyx_RefNannyFinishContext();
3385  return __pyx_r;
3386 }
3387 
3388 /* "BoundaryConditions.py":52
3389  * # setattr(BC_Base, name, default_value)
3390  *
3391  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3392  * """
3393  * Gets context from proteus.Context or
3394  */
3395 
3396 /* Python wrapper */
3397 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3398 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3399 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3400 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3401  PyObject *__pyx_v_context = 0;
3402  int __pyx_lineno = 0;
3403  const char *__pyx_filename = NULL;
3404  int __pyx_clineno = 0;
3405  PyObject *__pyx_r = 0;
3406  __Pyx_RefNannyDeclarations
3407  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3408  {
3409  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3410  PyObject* values[1] = {0};
3411  values[0] = ((PyObject *)Py_None);
3412  if (unlikely(__pyx_kwds)) {
3413  Py_ssize_t kw_args;
3414  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3415  switch (pos_args) {
3416  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3417  CYTHON_FALLTHROUGH;
3418  case 0: break;
3419  default: goto __pyx_L5_argtuple_error;
3420  }
3421  kw_args = PyDict_Size(__pyx_kwds);
3422  switch (pos_args) {
3423  case 0:
3424  if (kw_args > 0) {
3425  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3426  if (value) { values[0] = value; kw_args--; }
3427  }
3428  }
3429  if (unlikely(kw_args > 0)) {
3430  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3431  }
3432  } else {
3433  switch (PyTuple_GET_SIZE(__pyx_args)) {
3434  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3435  CYTHON_FALLTHROUGH;
3436  case 0: break;
3437  default: goto __pyx_L5_argtuple_error;
3438  }
3439  }
3440  __pyx_v_context = values[0];
3441  }
3442  goto __pyx_L4_argument_unpacking_done;
3443  __pyx_L5_argtuple_error:;
3444  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3445  __pyx_L3_error:;
3446  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3447  __Pyx_RefNannyFinishContext();
3448  return NULL;
3449  __pyx_L4_argument_unpacking_done:;
3450  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3451 
3452  /* function exit code */
3453  __Pyx_RefNannyFinishContext();
3454  return __pyx_r;
3455 }
3456 
3457 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3458  PyObject *__pyx_v_Context = NULL;
3459  PyObject *__pyx_r = NULL;
3460  __Pyx_TraceDeclarations
3461  __Pyx_RefNannyDeclarations
3462  int __pyx_t_1;
3463  PyObject *__pyx_t_2 = NULL;
3464  PyObject *__pyx_t_3 = NULL;
3465  PyObject *__pyx_t_4 = NULL;
3466  int __pyx_lineno = 0;
3467  const char *__pyx_filename = NULL;
3468  int __pyx_clineno = 0;
3469  __Pyx_TraceFrameInit(__pyx_codeobj_)
3470  __Pyx_RefNannySetupContext("getContext", 0);
3471  __Pyx_TraceCall("getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3472 
3473  /* "BoundaryConditions.py":61
3474  * if set to None, the context will be created from proteus.Context
3475  * """
3476  * if context: # <<<<<<<<<<<<<<
3477  * from proteus import Context
3478  * self.ct = Context.get()
3479  */
3480  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3481  if (__pyx_t_1) {
3482 
3483  /* "BoundaryConditions.py":62
3484  * """
3485  * if context:
3486  * from proteus import Context # <<<<<<<<<<<<<<
3487  * self.ct = Context.get()
3488  * else:
3489  */
3490  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3491  __Pyx_GOTREF(__pyx_t_2);
3492  __Pyx_INCREF(__pyx_n_s_Context);
3493  __Pyx_GIVEREF(__pyx_n_s_Context);
3494  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3495  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3496  __Pyx_GOTREF(__pyx_t_3);
3497  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3498  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3499  __Pyx_GOTREF(__pyx_t_2);
3500  __Pyx_INCREF(__pyx_t_2);
3501  __pyx_v_Context = __pyx_t_2;
3502  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3503  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3504 
3505  /* "BoundaryConditions.py":63
3506  * if context:
3507  * from proteus import Context
3508  * self.ct = Context.get() # <<<<<<<<<<<<<<
3509  * else:
3510  * self.ct = context
3511  */
3512  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3513  __Pyx_GOTREF(__pyx_t_2);
3514  __pyx_t_4 = NULL;
3515  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3516  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3517  if (likely(__pyx_t_4)) {
3518  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3519  __Pyx_INCREF(__pyx_t_4);
3520  __Pyx_INCREF(function);
3521  __Pyx_DECREF_SET(__pyx_t_2, function);
3522  }
3523  }
3524  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3525  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3526  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3527  __Pyx_GOTREF(__pyx_t_3);
3528  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3529  __Pyx_GIVEREF(__pyx_t_3);
3530  __Pyx_GOTREF(__pyx_v_self->ct);
3531  __Pyx_DECREF(__pyx_v_self->ct);
3532  __pyx_v_self->ct = __pyx_t_3;
3533  __pyx_t_3 = 0;
3534 
3535  /* "BoundaryConditions.py":61
3536  * if set to None, the context will be created from proteus.Context
3537  * """
3538  * if context: # <<<<<<<<<<<<<<
3539  * from proteus import Context
3540  * self.ct = Context.get()
3541  */
3542  goto __pyx_L3;
3543  }
3544 
3545  /* "BoundaryConditions.py":65
3546  * self.ct = Context.get()
3547  * else:
3548  * self.ct = context # <<<<<<<<<<<<<<
3549  *
3550  *
3551  */
3552  /*else*/ {
3553  __Pyx_INCREF(__pyx_v_context);
3554  __Pyx_GIVEREF(__pyx_v_context);
3555  __Pyx_GOTREF(__pyx_v_self->ct);
3556  __Pyx_DECREF(__pyx_v_self->ct);
3557  __pyx_v_self->ct = __pyx_v_context;
3558  }
3559  __pyx_L3:;
3560 
3561  /* "BoundaryConditions.py":52
3562  * # setattr(BC_Base, name, default_value)
3563  *
3564  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3565  * """
3566  * Gets context from proteus.Context or
3567  */
3568 
3569  /* function exit code */
3570  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3571  goto __pyx_L0;
3572  __pyx_L1_error:;
3573  __Pyx_XDECREF(__pyx_t_2);
3574  __Pyx_XDECREF(__pyx_t_3);
3575  __Pyx_XDECREF(__pyx_t_4);
3576  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3577  __pyx_r = NULL;
3578  __pyx_L0:;
3579  __Pyx_XDECREF(__pyx_v_Context);
3580  __Pyx_XGIVEREF(__pyx_r);
3581  __Pyx_TraceReturn(__pyx_r, 0);
3582  __Pyx_RefNannyFinishContext();
3583  return __pyx_r;
3584 }
3585 
3586 /* "BoundaryConditions.pxd":8
3587  * cdef double[:] _b_or
3588  * cdef public:
3589  * cdef int nd # <<<<<<<<<<<<<<
3590  * object Shape
3591  * str name
3592  */
3593 
3594 /* Python wrapper */
3595 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3596 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3597  PyObject *__pyx_r = 0;
3598  __Pyx_RefNannyDeclarations
3599  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3600  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3601 
3602  /* function exit code */
3603  __Pyx_RefNannyFinishContext();
3604  return __pyx_r;
3605 }
3606 
3607 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3608  PyObject *__pyx_r = NULL;
3609  __Pyx_TraceDeclarations
3610  __Pyx_RefNannyDeclarations
3611  PyObject *__pyx_t_1 = NULL;
3612  int __pyx_lineno = 0;
3613  const char *__pyx_filename = NULL;
3614  int __pyx_clineno = 0;
3615  __Pyx_RefNannySetupContext("__get__", 0);
3616  __Pyx_TraceCall("__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3617  __Pyx_XDECREF(__pyx_r);
3618  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3619  __Pyx_GOTREF(__pyx_t_1);
3620  __pyx_r = __pyx_t_1;
3621  __pyx_t_1 = 0;
3622  goto __pyx_L0;
3623 
3624  /* function exit code */
3625  __pyx_L1_error:;
3626  __Pyx_XDECREF(__pyx_t_1);
3627  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3628  __pyx_r = NULL;
3629  __pyx_L0:;
3630  __Pyx_XGIVEREF(__pyx_r);
3631  __Pyx_TraceReturn(__pyx_r, 0);
3632  __Pyx_RefNannyFinishContext();
3633  return __pyx_r;
3634 }
3635 
3636 /* Python wrapper */
3637 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3638 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3639  int __pyx_r;
3640  __Pyx_RefNannyDeclarations
3641  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3642  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3643 
3644  /* function exit code */
3645  __Pyx_RefNannyFinishContext();
3646  return __pyx_r;
3647 }
3648 
3649 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3650  int __pyx_r;
3651  __Pyx_TraceDeclarations
3652  __Pyx_RefNannyDeclarations
3653  int __pyx_t_1;
3654  int __pyx_lineno = 0;
3655  const char *__pyx_filename = NULL;
3656  int __pyx_clineno = 0;
3657  __Pyx_RefNannySetupContext("__set__", 0);
3658  __Pyx_TraceCall("__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3659  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3660  __pyx_v_self->nd = __pyx_t_1;
3661 
3662  /* function exit code */
3663  __pyx_r = 0;
3664  goto __pyx_L0;
3665  __pyx_L1_error:;
3666  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3667  __pyx_r = -1;
3668  __pyx_L0:;
3669  __Pyx_TraceReturn(Py_None, 0);
3670  __Pyx_RefNannyFinishContext();
3671  return __pyx_r;
3672 }
3673 
3674 /* "BoundaryConditions.pxd":9
3675  * cdef public:
3676  * cdef int nd
3677  * object Shape # <<<<<<<<<<<<<<
3678  * str name
3679  * str BC_type
3680  */
3681 
3682 /* Python wrapper */
3683 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3684 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3685  PyObject *__pyx_r = 0;
3686  __Pyx_RefNannyDeclarations
3687  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3688  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3689 
3690  /* function exit code */
3691  __Pyx_RefNannyFinishContext();
3692  return __pyx_r;
3693 }
3694 
3695 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3696  PyObject *__pyx_r = NULL;
3697  __Pyx_TraceDeclarations
3698  __Pyx_RefNannyDeclarations
3699  int __pyx_lineno = 0;
3700  const char *__pyx_filename = NULL;
3701  int __pyx_clineno = 0;
3702  __Pyx_RefNannySetupContext("__get__", 0);
3703  __Pyx_TraceCall("__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3704  __Pyx_XDECREF(__pyx_r);
3705  __Pyx_INCREF(__pyx_v_self->Shape);
3706  __pyx_r = __pyx_v_self->Shape;
3707  goto __pyx_L0;
3708 
3709  /* function exit code */
3710  __pyx_L1_error:;
3711  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3712  __pyx_r = NULL;
3713  __pyx_L0:;
3714  __Pyx_XGIVEREF(__pyx_r);
3715  __Pyx_TraceReturn(__pyx_r, 0);
3716  __Pyx_RefNannyFinishContext();
3717  return __pyx_r;
3718 }
3719 
3720 /* Python wrapper */
3721 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3722 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3723  int __pyx_r;
3724  __Pyx_RefNannyDeclarations
3725  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3726  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3727 
3728  /* function exit code */
3729  __Pyx_RefNannyFinishContext();
3730  return __pyx_r;
3731 }
3732 
3733 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3734  int __pyx_r;
3735  __Pyx_TraceDeclarations
3736  __Pyx_RefNannyDeclarations
3737  int __pyx_lineno = 0;
3738  const char *__pyx_filename = NULL;
3739  int __pyx_clineno = 0;
3740  __Pyx_RefNannySetupContext("__set__", 0);
3741  __Pyx_TraceCall("__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3742  __Pyx_INCREF(__pyx_v_value);
3743  __Pyx_GIVEREF(__pyx_v_value);
3744  __Pyx_GOTREF(__pyx_v_self->Shape);
3745  __Pyx_DECREF(__pyx_v_self->Shape);
3746  __pyx_v_self->Shape = __pyx_v_value;
3747 
3748  /* function exit code */
3749  __pyx_r = 0;
3750  goto __pyx_L0;
3751  __pyx_L1_error:;
3752  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3753  __pyx_r = -1;
3754  __pyx_L0:;
3755  __Pyx_TraceReturn(Py_None, 0);
3756  __Pyx_RefNannyFinishContext();
3757  return __pyx_r;
3758 }
3759 
3760 /* Python wrapper */
3761 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3762 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3763  int __pyx_r;
3764  __Pyx_RefNannyDeclarations
3765  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3766  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3767 
3768  /* function exit code */
3769  __Pyx_RefNannyFinishContext();
3770  return __pyx_r;
3771 }
3772 
3773 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3774  int __pyx_r;
3775  __Pyx_TraceDeclarations
3776  __Pyx_RefNannyDeclarations
3777  int __pyx_lineno = 0;
3778  const char *__pyx_filename = NULL;
3779  int __pyx_clineno = 0;
3780  __Pyx_RefNannySetupContext("__del__", 0);
3781  __Pyx_TraceCall("__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3782  __Pyx_INCREF(Py_None);
3783  __Pyx_GIVEREF(Py_None);
3784  __Pyx_GOTREF(__pyx_v_self->Shape);
3785  __Pyx_DECREF(__pyx_v_self->Shape);
3786  __pyx_v_self->Shape = Py_None;
3787 
3788  /* function exit code */
3789  __pyx_r = 0;
3790  goto __pyx_L0;
3791  __pyx_L1_error:;
3792  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3793  __pyx_r = -1;
3794  __pyx_L0:;
3795  __Pyx_TraceReturn(Py_None, 0);
3796  __Pyx_RefNannyFinishContext();
3797  return __pyx_r;
3798 }
3799 
3800 /* "BoundaryConditions.pxd":10
3801  * cdef int nd
3802  * object Shape
3803  * str name # <<<<<<<<<<<<<<
3804  * str BC_type
3805  * object ct
3806  */
3807 
3808 /* Python wrapper */
3809 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3810 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3811  PyObject *__pyx_r = 0;
3812  __Pyx_RefNannyDeclarations
3813  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3814  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3815 
3816  /* function exit code */
3817  __Pyx_RefNannyFinishContext();
3818  return __pyx_r;
3819 }
3820 
3821 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3822  PyObject *__pyx_r = NULL;
3823  __Pyx_TraceDeclarations
3824  __Pyx_RefNannyDeclarations
3825  int __pyx_lineno = 0;
3826  const char *__pyx_filename = NULL;
3827  int __pyx_clineno = 0;
3828  __Pyx_RefNannySetupContext("__get__", 0);
3829  __Pyx_TraceCall("__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3830  __Pyx_XDECREF(__pyx_r);
3831  __Pyx_INCREF(__pyx_v_self->name);
3832  __pyx_r = __pyx_v_self->name;
3833  goto __pyx_L0;
3834 
3835  /* function exit code */
3836  __pyx_L1_error:;
3837  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3838  __pyx_r = NULL;
3839  __pyx_L0:;
3840  __Pyx_XGIVEREF(__pyx_r);
3841  __Pyx_TraceReturn(__pyx_r, 0);
3842  __Pyx_RefNannyFinishContext();
3843  return __pyx_r;
3844 }
3845 
3846 /* Python wrapper */
3847 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3848 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3849  int __pyx_r;
3850  __Pyx_RefNannyDeclarations
3851  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3852  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3853 
3854  /* function exit code */
3855  __Pyx_RefNannyFinishContext();
3856  return __pyx_r;
3857 }
3858 
3859 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3860  int __pyx_r;
3861  __Pyx_TraceDeclarations
3862  __Pyx_RefNannyDeclarations
3863  PyObject *__pyx_t_1 = NULL;
3864  int __pyx_lineno = 0;
3865  const char *__pyx_filename = NULL;
3866  int __pyx_clineno = 0;
3867  __Pyx_RefNannySetupContext("__set__", 0);
3868  __Pyx_TraceCall("__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3869  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3870  __pyx_t_1 = __pyx_v_value;
3871  __Pyx_INCREF(__pyx_t_1);
3872  __Pyx_GIVEREF(__pyx_t_1);
3873  __Pyx_GOTREF(__pyx_v_self->name);
3874  __Pyx_DECREF(__pyx_v_self->name);
3875  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3876  __pyx_t_1 = 0;
3877 
3878  /* function exit code */
3879  __pyx_r = 0;
3880  goto __pyx_L0;
3881  __pyx_L1_error:;
3882  __Pyx_XDECREF(__pyx_t_1);
3883  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3884  __pyx_r = -1;
3885  __pyx_L0:;
3886  __Pyx_TraceReturn(Py_None, 0);
3887  __Pyx_RefNannyFinishContext();
3888  return __pyx_r;
3889 }
3890 
3891 /* Python wrapper */
3892 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
3893 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3894  int __pyx_r;
3895  __Pyx_RefNannyDeclarations
3896  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3897  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3898 
3899  /* function exit code */
3900  __Pyx_RefNannyFinishContext();
3901  return __pyx_r;
3902 }
3903 
3904 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3905  int __pyx_r;
3906  __Pyx_TraceDeclarations
3907  __Pyx_RefNannyDeclarations
3908  int __pyx_lineno = 0;
3909  const char *__pyx_filename = NULL;
3910  int __pyx_clineno = 0;
3911  __Pyx_RefNannySetupContext("__del__", 0);
3912  __Pyx_TraceCall("__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3913  __Pyx_INCREF(Py_None);
3914  __Pyx_GIVEREF(Py_None);
3915  __Pyx_GOTREF(__pyx_v_self->name);
3916  __Pyx_DECREF(__pyx_v_self->name);
3917  __pyx_v_self->name = ((PyObject*)Py_None);
3918 
3919  /* function exit code */
3920  __pyx_r = 0;
3921  goto __pyx_L0;
3922  __pyx_L1_error:;
3923  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3924  __pyx_r = -1;
3925  __pyx_L0:;
3926  __Pyx_TraceReturn(Py_None, 0);
3927  __Pyx_RefNannyFinishContext();
3928  return __pyx_r;
3929 }
3930 
3931 /* "BoundaryConditions.pxd":11
3932  * object Shape
3933  * str name
3934  * str BC_type # <<<<<<<<<<<<<<
3935  * object ct
3936  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3937  */
3938 
3939 /* Python wrapper */
3940 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
3941 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3942  PyObject *__pyx_r = 0;
3943  __Pyx_RefNannyDeclarations
3944  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3945  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3946 
3947  /* function exit code */
3948  __Pyx_RefNannyFinishContext();
3949  return __pyx_r;
3950 }
3951 
3952 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3953  PyObject *__pyx_r = NULL;
3954  __Pyx_TraceDeclarations
3955  __Pyx_RefNannyDeclarations
3956  int __pyx_lineno = 0;
3957  const char *__pyx_filename = NULL;
3958  int __pyx_clineno = 0;
3959  __Pyx_RefNannySetupContext("__get__", 0);
3960  __Pyx_TraceCall("__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3961  __Pyx_XDECREF(__pyx_r);
3962  __Pyx_INCREF(__pyx_v_self->BC_type);
3963  __pyx_r = __pyx_v_self->BC_type;
3964  goto __pyx_L0;
3965 
3966  /* function exit code */
3967  __pyx_L1_error:;
3968  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3969  __pyx_r = NULL;
3970  __pyx_L0:;
3971  __Pyx_XGIVEREF(__pyx_r);
3972  __Pyx_TraceReturn(__pyx_r, 0);
3973  __Pyx_RefNannyFinishContext();
3974  return __pyx_r;
3975 }
3976 
3977 /* Python wrapper */
3978 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3979 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3980  int __pyx_r;
3981  __Pyx_RefNannyDeclarations
3982  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3983  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3984 
3985  /* function exit code */
3986  __Pyx_RefNannyFinishContext();
3987  return __pyx_r;
3988 }
3989 
3990 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3991  int __pyx_r;
3992  __Pyx_TraceDeclarations
3993  __Pyx_RefNannyDeclarations
3994  PyObject *__pyx_t_1 = NULL;
3995  int __pyx_lineno = 0;
3996  const char *__pyx_filename = NULL;
3997  int __pyx_clineno = 0;
3998  __Pyx_RefNannySetupContext("__set__", 0);
3999  __Pyx_TraceCall("__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4000  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4001  __pyx_t_1 = __pyx_v_value;
4002  __Pyx_INCREF(__pyx_t_1);
4003  __Pyx_GIVEREF(__pyx_t_1);
4004  __Pyx_GOTREF(__pyx_v_self->BC_type);
4005  __Pyx_DECREF(__pyx_v_self->BC_type);
4006  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4007  __pyx_t_1 = 0;
4008 
4009  /* function exit code */
4010  __pyx_r = 0;
4011  goto __pyx_L0;
4012  __pyx_L1_error:;
4013  __Pyx_XDECREF(__pyx_t_1);
4014  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4015  __pyx_r = -1;
4016  __pyx_L0:;
4017  __Pyx_TraceReturn(Py_None, 0);
4018  __Pyx_RefNannyFinishContext();
4019  return __pyx_r;
4020 }
4021 
4022 /* Python wrapper */
4023 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
4024 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4025  int __pyx_r;
4026  __Pyx_RefNannyDeclarations
4027  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4028  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4029 
4030  /* function exit code */
4031  __Pyx_RefNannyFinishContext();
4032  return __pyx_r;
4033 }
4034 
4035 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4036  int __pyx_r;
4037  __Pyx_TraceDeclarations
4038  __Pyx_RefNannyDeclarations
4039  int __pyx_lineno = 0;
4040  const char *__pyx_filename = NULL;
4041  int __pyx_clineno = 0;
4042  __Pyx_RefNannySetupContext("__del__", 0);
4043  __Pyx_TraceCall("__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4044  __Pyx_INCREF(Py_None);
4045  __Pyx_GIVEREF(Py_None);
4046  __Pyx_GOTREF(__pyx_v_self->BC_type);
4047  __Pyx_DECREF(__pyx_v_self->BC_type);
4048  __pyx_v_self->BC_type = ((PyObject*)Py_None);
4049 
4050  /* function exit code */
4051  __pyx_r = 0;
4052  goto __pyx_L0;
4053  __pyx_L1_error:;
4054  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4055  __pyx_r = -1;
4056  __pyx_L0:;
4057  __Pyx_TraceReturn(Py_None, 0);
4058  __Pyx_RefNannyFinishContext();
4059  return __pyx_r;
4060 }
4061 
4062 /* "BoundaryConditions.pxd":12
4063  * str name
4064  * str BC_type
4065  * object ct # <<<<<<<<<<<<<<
4066  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
4067  * # cpdef void getContext(BC_Base cls, object context=*)
4068  */
4069 
4070 /* Python wrapper */
4071 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
4072 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4073  PyObject *__pyx_r = 0;
4074  __Pyx_RefNannyDeclarations
4075  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4076  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4077 
4078  /* function exit code */
4079  __Pyx_RefNannyFinishContext();
4080  return __pyx_r;
4081 }
4082 
4083 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4084  PyObject *__pyx_r = NULL;
4085  __Pyx_TraceDeclarations
4086  __Pyx_RefNannyDeclarations
4087  int __pyx_lineno = 0;
4088  const char *__pyx_filename = NULL;
4089  int __pyx_clineno = 0;
4090  __Pyx_RefNannySetupContext("__get__", 0);
4091  __Pyx_TraceCall("__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4092  __Pyx_XDECREF(__pyx_r);
4093  __Pyx_INCREF(__pyx_v_self->ct);
4094  __pyx_r = __pyx_v_self->ct;
4095  goto __pyx_L0;
4096 
4097  /* function exit code */
4098  __pyx_L1_error:;
4099  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4100  __pyx_r = NULL;
4101  __pyx_L0:;
4102  __Pyx_XGIVEREF(__pyx_r);
4103  __Pyx_TraceReturn(__pyx_r, 0);
4104  __Pyx_RefNannyFinishContext();
4105  return __pyx_r;
4106 }
4107 
4108 /* Python wrapper */
4109 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4110 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4111  int __pyx_r;
4112  __Pyx_RefNannyDeclarations
4113  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4114  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4115 
4116  /* function exit code */
4117  __Pyx_RefNannyFinishContext();
4118  return __pyx_r;
4119 }
4120 
4121 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4122  int __pyx_r;
4123  __Pyx_TraceDeclarations
4124  __Pyx_RefNannyDeclarations
4125  int __pyx_lineno = 0;
4126  const char *__pyx_filename = NULL;
4127  int __pyx_clineno = 0;
4128  __Pyx_RefNannySetupContext("__set__", 0);
4129  __Pyx_TraceCall("__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4130  __Pyx_INCREF(__pyx_v_value);
4131  __Pyx_GIVEREF(__pyx_v_value);
4132  __Pyx_GOTREF(__pyx_v_self->ct);
4133  __Pyx_DECREF(__pyx_v_self->ct);
4134  __pyx_v_self->ct = __pyx_v_value;
4135 
4136  /* function exit code */
4137  __pyx_r = 0;
4138  goto __pyx_L0;
4139  __pyx_L1_error:;
4140  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4141  __pyx_r = -1;
4142  __pyx_L0:;
4143  __Pyx_TraceReturn(Py_None, 0);
4144  __Pyx_RefNannyFinishContext();
4145  return __pyx_r;
4146 }
4147 
4148 /* Python wrapper */
4149 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
4150 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4151  int __pyx_r;
4152  __Pyx_RefNannyDeclarations
4153  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4154  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4155 
4156  /* function exit code */
4157  __Pyx_RefNannyFinishContext();
4158  return __pyx_r;
4159 }
4160 
4161 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4162  int __pyx_r;
4163  __Pyx_TraceDeclarations
4164  __Pyx_RefNannyDeclarations
4165  int __pyx_lineno = 0;
4166  const char *__pyx_filename = NULL;
4167  int __pyx_clineno = 0;
4168  __Pyx_RefNannySetupContext("__del__", 0);
4169  __Pyx_TraceCall("__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4170  __Pyx_INCREF(Py_None);
4171  __Pyx_GIVEREF(Py_None);
4172  __Pyx_GOTREF(__pyx_v_self->ct);
4173  __Pyx_DECREF(__pyx_v_self->ct);
4174  __pyx_v_self->ct = Py_None;
4175 
4176  /* function exit code */
4177  __pyx_r = 0;
4178  goto __pyx_L0;
4179  __pyx_L1_error:;
4180  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4181  __pyx_r = -1;
4182  __pyx_L0:;
4183  __Pyx_TraceReturn(Py_None, 0);
4184  __Pyx_RefNannyFinishContext();
4185  return __pyx_r;
4186 }
4187 
4188 /* "(tree fragment)":1
4189  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4190  * cdef tuple state
4191  * cdef object _dict
4192  */
4193 
4194 /* Python wrapper */
4195 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4196 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] = "BC_Base.__reduce_cython__(self)";
4197 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4198 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4199  PyObject *__pyx_r = 0;
4200  __Pyx_RefNannyDeclarations
4201  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4202  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4203 
4204  /* function exit code */
4205  __Pyx_RefNannyFinishContext();
4206  return __pyx_r;
4207 }
4208 
4209 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4210  PyObject *__pyx_v_state = 0;
4211  PyObject *__pyx_v__dict = 0;
4212  int __pyx_v_use_setstate;
4213  PyObject *__pyx_r = NULL;
4214  __Pyx_TraceDeclarations
4215  __Pyx_RefNannyDeclarations
4216  PyObject *__pyx_t_1 = NULL;
4217  PyObject *__pyx_t_2 = NULL;
4218  PyObject *__pyx_t_3 = NULL;
4219  int __pyx_t_4;
4220  int __pyx_t_5;
4221  int __pyx_t_6;
4222  int __pyx_lineno = 0;
4223  const char *__pyx_filename = NULL;
4224  int __pyx_clineno = 0;
4225  __Pyx_TraceFrameInit(__pyx_codeobj__2)
4226  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4227  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4228 
4229  /* "(tree fragment)":5
4230  * cdef object _dict
4231  * cdef bint use_setstate
4232  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
4233  * _dict = getattr(self, '__dict__', None)
4234  * if _dict is not None:
4235  */
4236  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4237  __Pyx_GOTREF(__pyx_t_1);
4238  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4239  __Pyx_GOTREF(__pyx_t_2);
4240  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4241  __Pyx_GOTREF(__pyx_t_3);
4242  __Pyx_INCREF(__pyx_v_self->BC_type);
4243  __Pyx_GIVEREF(__pyx_v_self->BC_type);
4244  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4245  __Pyx_INCREF(__pyx_v_self->Shape);
4246  __Pyx_GIVEREF(__pyx_v_self->Shape);
4247  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4248  __Pyx_GIVEREF(__pyx_t_1);
4249  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4250  __Pyx_INCREF(__pyx_v_self->ct);
4251  __Pyx_GIVEREF(__pyx_v_self->ct);
4252  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4253  __Pyx_INCREF(__pyx_v_self->name);
4254  __Pyx_GIVEREF(__pyx_v_self->name);
4255  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4256  __Pyx_GIVEREF(__pyx_t_2);
4257  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4258  __pyx_t_1 = 0;
4259  __pyx_t_2 = 0;
4260  __pyx_v_state = ((PyObject*)__pyx_t_3);
4261  __pyx_t_3 = 0;
4262 
4263  /* "(tree fragment)":6
4264  * cdef bint use_setstate
4265  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4266  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
4267  * if _dict is not None:
4268  * state += (_dict,)
4269  */
4270  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4271  __Pyx_GOTREF(__pyx_t_3);
4272  __pyx_v__dict = __pyx_t_3;
4273  __pyx_t_3 = 0;
4274 
4275  /* "(tree fragment)":7
4276  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4277  * _dict = getattr(self, '__dict__', None)
4278  * if _dict is not None: # <<<<<<<<<<<<<<
4279  * state += (_dict,)
4280  * use_setstate = True
4281  */
4282  __pyx_t_4 = (__pyx_v__dict != Py_None);
4283  __pyx_t_5 = (__pyx_t_4 != 0);
4284  if (__pyx_t_5) {
4285 
4286  /* "(tree fragment)":8
4287  * _dict = getattr(self, '__dict__', None)
4288  * if _dict is not None:
4289  * state += (_dict,) # <<<<<<<<<<<<<<
4290  * use_setstate = True
4291  * else:
4292  */
4293  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4294  __Pyx_GOTREF(__pyx_t_3);
4295  __Pyx_INCREF(__pyx_v__dict);
4296  __Pyx_GIVEREF(__pyx_v__dict);
4297  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4298  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4299  __Pyx_GOTREF(__pyx_t_2);
4300  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4301  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4302  __pyx_t_2 = 0;
4303 
4304  /* "(tree fragment)":9
4305  * if _dict is not None:
4306  * state += (_dict,)
4307  * use_setstate = True # <<<<<<<<<<<<<<
4308  * else:
4309  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4310  */
4311  __pyx_v_use_setstate = 1;
4312 
4313  /* "(tree fragment)":7
4314  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4315  * _dict = getattr(self, '__dict__', None)
4316  * if _dict is not None: # <<<<<<<<<<<<<<
4317  * state += (_dict,)
4318  * use_setstate = True
4319  */
4320  goto __pyx_L3;
4321  }
4322 
4323  /* "(tree fragment)":11
4324  * use_setstate = True
4325  * else:
4326  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
4327  * if use_setstate:
4328  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4329  */
4330  /*else*/ {
4331  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4332  __pyx_t_6 = (__pyx_t_4 != 0);
4333  if (!__pyx_t_6) {
4334  } else {
4335  __pyx_t_5 = __pyx_t_6;
4336  goto __pyx_L4_bool_binop_done;
4337  }
4338  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4339  __pyx_t_4 = (__pyx_t_6 != 0);
4340  if (!__pyx_t_4) {
4341  } else {
4342  __pyx_t_5 = __pyx_t_4;
4343  goto __pyx_L4_bool_binop_done;
4344  }
4345  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4346  __pyx_t_6 = (__pyx_t_4 != 0);
4347  if (!__pyx_t_6) {
4348  } else {
4349  __pyx_t_5 = __pyx_t_6;
4350  goto __pyx_L4_bool_binop_done;
4351  }
4352  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4353  __pyx_t_4 = (__pyx_t_6 != 0);
4354  __pyx_t_5 = __pyx_t_4;
4355  __pyx_L4_bool_binop_done:;
4356  __pyx_v_use_setstate = __pyx_t_5;
4357  }
4358  __pyx_L3:;
4359 
4360  /* "(tree fragment)":12
4361  * else:
4362  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4363  * if use_setstate: # <<<<<<<<<<<<<<
4364  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4365  * else:
4366  */
4367  __pyx_t_5 = (__pyx_v_use_setstate != 0);
4368  if (__pyx_t_5) {
4369 
4370  /* "(tree fragment)":13
4371  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4372  * if use_setstate:
4373  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
4374  * else:
4375  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4376  */
4377  __Pyx_XDECREF(__pyx_r);
4378  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4379  __Pyx_GOTREF(__pyx_t_2);
4380  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4381  __Pyx_GOTREF(__pyx_t_3);
4382  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4383  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4384  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4385  __Pyx_INCREF(__pyx_int_158231071);
4386  __Pyx_GIVEREF(__pyx_int_158231071);
4387  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4388  __Pyx_INCREF(Py_None);
4389  __Pyx_GIVEREF(Py_None);
4390  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4391  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4392  __Pyx_GOTREF(__pyx_t_1);
4393  __Pyx_GIVEREF(__pyx_t_2);
4394  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4395  __Pyx_GIVEREF(__pyx_t_3);
4396  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4397  __Pyx_INCREF(__pyx_v_state);
4398  __Pyx_GIVEREF(__pyx_v_state);
4399  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4400  __pyx_t_2 = 0;
4401  __pyx_t_3 = 0;
4402  __pyx_r = __pyx_t_1;
4403  __pyx_t_1 = 0;
4404  goto __pyx_L0;
4405 
4406  /* "(tree fragment)":12
4407  * else:
4408  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4409  * if use_setstate: # <<<<<<<<<<<<<<
4410  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4411  * else:
4412  */
4413  }
4414 
4415  /* "(tree fragment)":15
4416  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4417  * else:
4418  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
4419  * def __setstate_cython__(self, __pyx_state):
4420  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4421  */
4422  /*else*/ {
4423  __Pyx_XDECREF(__pyx_r);
4424  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4425  __Pyx_GOTREF(__pyx_t_1);
4426  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4427  __Pyx_GOTREF(__pyx_t_3);
4428  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4429  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4430  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4431  __Pyx_INCREF(__pyx_int_158231071);
4432  __Pyx_GIVEREF(__pyx_int_158231071);
4433  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4434  __Pyx_INCREF(__pyx_v_state);
4435  __Pyx_GIVEREF(__pyx_v_state);
4436  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4437  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4438  __Pyx_GOTREF(__pyx_t_2);
4439  __Pyx_GIVEREF(__pyx_t_1);
4440  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4441  __Pyx_GIVEREF(__pyx_t_3);
4442  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4443  __pyx_t_1 = 0;
4444  __pyx_t_3 = 0;
4445  __pyx_r = __pyx_t_2;
4446  __pyx_t_2 = 0;
4447  goto __pyx_L0;
4448  }
4449 
4450  /* "(tree fragment)":1
4451  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4452  * cdef tuple state
4453  * cdef object _dict
4454  */
4455 
4456  /* function exit code */
4457  __pyx_L1_error:;
4458  __Pyx_XDECREF(__pyx_t_1);
4459  __Pyx_XDECREF(__pyx_t_2);
4460  __Pyx_XDECREF(__pyx_t_3);
4461  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4462  __pyx_r = NULL;
4463  __pyx_L0:;
4464  __Pyx_XDECREF(__pyx_v_state);
4465  __Pyx_XDECREF(__pyx_v__dict);
4466  __Pyx_XGIVEREF(__pyx_r);
4467  __Pyx_TraceReturn(__pyx_r, 0);
4468  __Pyx_RefNannyFinishContext();
4469  return __pyx_r;
4470 }
4471 
4472 /* "(tree fragment)":16
4473  * else:
4474  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4475  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4476  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4477  */
4478 
4479 /* Python wrapper */
4480 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4481 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] = "BC_Base.__setstate_cython__(self, __pyx_state)";
4482 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4483 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4484  PyObject *__pyx_r = 0;
4485  __Pyx_RefNannyDeclarations
4486  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4487  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4488 
4489  /* function exit code */
4490  __Pyx_RefNannyFinishContext();
4491  return __pyx_r;
4492 }
4493 
4494 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4495  PyObject *__pyx_r = NULL;
4496  __Pyx_TraceDeclarations
4497  __Pyx_RefNannyDeclarations
4498  PyObject *__pyx_t_1 = NULL;
4499  int __pyx_lineno = 0;
4500  const char *__pyx_filename = NULL;
4501  int __pyx_clineno = 0;
4502  __Pyx_TraceFrameInit(__pyx_codeobj__3)
4503  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4504  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4505 
4506  /* "(tree fragment)":17
4507  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4508  * def __setstate_cython__(self, __pyx_state):
4509  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
4510  */
4511  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4512  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4513  __Pyx_GOTREF(__pyx_t_1);
4514  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4515 
4516  /* "(tree fragment)":16
4517  * else:
4518  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4519  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4520  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4521  */
4522 
4523  /* function exit code */
4524  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4525  goto __pyx_L0;
4526  __pyx_L1_error:;
4527  __Pyx_XDECREF(__pyx_t_1);
4528  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4529  __pyx_r = NULL;
4530  __pyx_L0:;
4531  __Pyx_XGIVEREF(__pyx_r);
4532  __Pyx_TraceReturn(__pyx_r, 0);
4533  __Pyx_RefNannyFinishContext();
4534  return __pyx_r;
4535 }
4536 
4537 /* "BoundaryConditions.py":78
4538  * no boundary condition
4539  * """
4540  * def __init__(self): # <<<<<<<<<<<<<<
4541  * self.uOfXT = None
4542  *
4543  */
4544 
4545 /* Python wrapper */
4546 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4547 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4548  int __pyx_r;
4549  __Pyx_RefNannyDeclarations
4550  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4551  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4552  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4553  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4554  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4555 
4556  /* function exit code */
4557  __Pyx_RefNannyFinishContext();
4558  return __pyx_r;
4559 }
4560 
4561 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4562  int __pyx_r;
4563  __Pyx_TraceDeclarations
4564  __Pyx_RefNannyDeclarations
4565  int __pyx_lineno = 0;
4566  const char *__pyx_filename = NULL;
4567  int __pyx_clineno = 0;
4568  __Pyx_RefNannySetupContext("__init__", 0);
4569  __Pyx_TraceCall("__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4570 
4571  /* "BoundaryConditions.py":79
4572  * """
4573  * def __init__(self):
4574  * self.uOfXT = None # <<<<<<<<<<<<<<
4575  *
4576  * def init_cython(self):
4577  */
4578  __Pyx_INCREF(Py_None);
4579  __Pyx_GIVEREF(Py_None);
4580  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4581  __Pyx_DECREF(__pyx_v_self->uOfXT);
4582  __pyx_v_self->uOfXT = Py_None;
4583 
4584  /* "BoundaryConditions.py":78
4585  * no boundary condition
4586  * """
4587  * def __init__(self): # <<<<<<<<<<<<<<
4588  * self.uOfXT = None
4589  *
4590  */
4591 
4592  /* function exit code */
4593  __pyx_r = 0;
4594  goto __pyx_L0;
4595  __pyx_L1_error:;
4596  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4597  __pyx_r = -1;
4598  __pyx_L0:;
4599  __Pyx_TraceReturn(Py_None, 0);
4600  __Pyx_RefNannyFinishContext();
4601  return __pyx_r;
4602 }
4603 
4604 /* "BoundaryConditions.py":81
4605  * self.uOfXT = None
4606  *
4607  * def init_cython(self): # <<<<<<<<<<<<<<
4608  * return self.uOfXT
4609  *
4610  */
4611 
4612 /* Python wrapper */
4613 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4614 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] = "BoundaryCondition.init_cython(self)";
4615 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4616 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4617  PyObject *__pyx_r = 0;
4618  __Pyx_RefNannyDeclarations
4619  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4620  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4621 
4622  /* function exit code */
4623  __Pyx_RefNannyFinishContext();
4624  return __pyx_r;
4625 }
4626 
4627 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4628  PyObject *__pyx_r = NULL;
4629  __Pyx_TraceDeclarations
4630  __Pyx_RefNannyDeclarations
4631  int __pyx_lineno = 0;
4632  const char *__pyx_filename = NULL;
4633  int __pyx_clineno = 0;
4634  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4635  __Pyx_RefNannySetupContext("init_cython", 0);
4636  __Pyx_TraceCall("init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4637 
4638  /* "BoundaryConditions.py":82
4639  *
4640  * def init_cython(self):
4641  * return self.uOfXT # <<<<<<<<<<<<<<
4642  *
4643  * def resetBC(self):
4644  */
4645  __Pyx_XDECREF(__pyx_r);
4646  __Pyx_INCREF(__pyx_v_self->uOfXT);
4647  __pyx_r = __pyx_v_self->uOfXT;
4648  goto __pyx_L0;
4649 
4650  /* "BoundaryConditions.py":81
4651  * self.uOfXT = None
4652  *
4653  * def init_cython(self): # <<<<<<<<<<<<<<
4654  * return self.uOfXT
4655  *
4656  */
4657 
4658  /* function exit code */
4659  __pyx_L1_error:;
4660  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4661  __pyx_r = NULL;
4662  __pyx_L0:;
4663  __Pyx_XGIVEREF(__pyx_r);
4664  __Pyx_TraceReturn(__pyx_r, 0);
4665  __Pyx_RefNannyFinishContext();
4666  return __pyx_r;
4667 }
4668 
4669 /* "BoundaryConditions.py":84
4670  * return self.uOfXT
4671  *
4672  * def resetBC(self): # <<<<<<<<<<<<<<
4673  * self.uOfXT = None
4674  *
4675  */
4676 
4677 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4678 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4679  __Pyx_TraceDeclarations
4680  __Pyx_RefNannyDeclarations
4681  PyObject *__pyx_t_1 = NULL;
4682  PyObject *__pyx_t_2 = NULL;
4683  PyObject *__pyx_t_3 = NULL;
4684  PyObject *__pyx_t_4 = NULL;
4685  int __pyx_lineno = 0;
4686  const char *__pyx_filename = NULL;
4687  int __pyx_clineno = 0;
4688  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4689  __Pyx_RefNannySetupContext("resetBC", 0);
4690  __Pyx_TraceCall("resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4691  /* Check if called by wrapper */
4692  if (unlikely(__pyx_skip_dispatch)) ;
4693  /* Check if overridden in Python */
4694  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4695  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4696  static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4697  if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4698  PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4699  #endif
4700  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4701  __Pyx_GOTREF(__pyx_t_1);
4702  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4703  __Pyx_INCREF(__pyx_t_1);
4704  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4705  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4706  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4707  if (likely(__pyx_t_4)) {
4708  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4709  __Pyx_INCREF(__pyx_t_4);
4710  __Pyx_INCREF(function);
4711  __Pyx_DECREF_SET(__pyx_t_3, function);
4712  }
4713  }
4714  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4715  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4716  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4717  __Pyx_GOTREF(__pyx_t_2);
4718  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4719  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4720  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4721  goto __pyx_L0;
4722  }
4723  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4724  __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4725  __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4726  if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4727  __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4728  }
4729  #endif
4730  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4731  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4732  }
4733  #endif
4734  }
4735 
4736  /* "BoundaryConditions.py":85
4737  *
4738  * def resetBC(self):
4739  * self.uOfXT = None # <<<<<<<<<<<<<<
4740  *
4741  * def setConstantBC(self, value):
4742  */
4743  __Pyx_INCREF(Py_None);
4744  __Pyx_GIVEREF(Py_None);
4745  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4746  __Pyx_DECREF(__pyx_v_self->uOfXT);
4747  __pyx_v_self->uOfXT = Py_None;
4748 
4749  /* "BoundaryConditions.py":84
4750  * return self.uOfXT
4751  *
4752  * def resetBC(self): # <<<<<<<<<<<<<<
4753  * self.uOfXT = None
4754  *
4755  */
4756 
4757  /* function exit code */
4758  goto __pyx_L0;
4759  __pyx_L1_error:;
4760  __Pyx_XDECREF(__pyx_t_1);
4761  __Pyx_XDECREF(__pyx_t_2);
4762  __Pyx_XDECREF(__pyx_t_3);
4763  __Pyx_XDECREF(__pyx_t_4);
4764  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4765  __pyx_L0:;
4766  __Pyx_TraceReturn(Py_None, 0);
4767  __Pyx_RefNannyFinishContext();
4768 }
4769 
4770 /* Python wrapper */
4771 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4772 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] = "BoundaryCondition.resetBC(self) -> void";
4773 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4774 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4775  PyObject *__pyx_r = 0;
4776  __Pyx_RefNannyDeclarations
4777  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4778  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4779 
4780  /* function exit code */
4781  __Pyx_RefNannyFinishContext();
4782  return __pyx_r;
4783 }
4784 
4785 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4786  PyObject *__pyx_r = NULL;
4787  __Pyx_TraceDeclarations
4788  __Pyx_RefNannyDeclarations
4789  PyObject *__pyx_t_1 = NULL;
4790  int __pyx_lineno = 0;
4791  const char *__pyx_filename = NULL;
4792  int __pyx_clineno = 0;
4793  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4794  __Pyx_RefNannySetupContext("resetBC", 0);
4795  __Pyx_TraceCall("resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4796  __Pyx_XDECREF(__pyx_r);
4797  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4798  __Pyx_GOTREF(__pyx_t_1);
4799  __pyx_r = __pyx_t_1;
4800  __pyx_t_1 = 0;
4801  goto __pyx_L0;
4802 
4803  /* function exit code */
4804  __pyx_L1_error:;
4805  __Pyx_XDECREF(__pyx_t_1);
4806  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4807  __pyx_r = NULL;
4808  __pyx_L0:;
4809  __Pyx_XGIVEREF(__pyx_r);
4810  __Pyx_TraceReturn(__pyx_r, 0);
4811  __Pyx_RefNannyFinishContext();
4812  return __pyx_r;
4813 }
4814 
4815 /* "BoundaryConditions.py":87
4816  * self.uOfXT = None
4817  *
4818  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4819  * """
4820  * function returning constant BC
4821  */
4822 
4823 /* Python wrapper */
4824 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4825 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4826 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4827 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4828  PyObject *__pyx_r = 0;
4829  __Pyx_RefNannyDeclarations
4830  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4831  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4832 
4833  /* function exit code */
4834  __Pyx_RefNannyFinishContext();
4835  return __pyx_r;
4836 }
4837 
4838 /* "BoundaryConditions.py":97
4839  *
4840  * """
4841  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
4842  *
4843  *
4844  */
4845 
4846 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4847  PyObject *__pyx_r = NULL;
4848  __Pyx_TraceDeclarations
4849  __Pyx_RefNannyDeclarations
4850  PyObject *__pyx_t_1 = NULL;
4851  PyObject *__pyx_t_2 = NULL;
4852  int __pyx_lineno = 0;
4853  const char *__pyx_filename = NULL;
4854  int __pyx_clineno = 0;
4855  __Pyx_RefNannySetupContext("__defaults__", 0);
4856  __Pyx_TraceCall("__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4857  __Pyx_XDECREF(__pyx_r);
4858  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4859  __Pyx_GOTREF(__pyx_t_1);
4860  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4861  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4862  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4863  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4864  __Pyx_GOTREF(__pyx_t_2);
4865  __Pyx_GIVEREF(__pyx_t_1);
4866  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4867  __Pyx_INCREF(Py_None);
4868  __Pyx_GIVEREF(Py_None);
4869  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4870  __pyx_t_1 = 0;
4871  __pyx_r = __pyx_t_2;
4872  __pyx_t_2 = 0;
4873  goto __pyx_L0;
4874 
4875  /* function exit code */
4876  __pyx_L1_error:;
4877  __Pyx_XDECREF(__pyx_t_1);
4878  __Pyx_XDECREF(__pyx_t_2);
4879  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4880  __pyx_r = NULL;
4881  __pyx_L0:;
4882  __Pyx_XGIVEREF(__pyx_r);
4883  __Pyx_TraceReturn(__pyx_r, 0);
4884  __Pyx_RefNannyFinishContext();
4885  return __pyx_r;
4886 }
4887 
4888 /* Python wrapper */
4889 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4890 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4891 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4892  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4893  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4894  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4895  int __pyx_lineno = 0;
4896  const char *__pyx_filename = NULL;
4897  int __pyx_clineno = 0;
4898  PyObject *__pyx_r = 0;
4899  __Pyx_RefNannyDeclarations
4900  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4901  {
4902  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4903  PyObject* values[3] = {0,0,0};
4904  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4905  values[2] = __pyx_dynamic_args->__pyx_arg_n;
4906  if (unlikely(__pyx_kwds)) {
4907  Py_ssize_t kw_args;
4908  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4909  switch (pos_args) {
4910  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4911  CYTHON_FALLTHROUGH;
4912  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4913  CYTHON_FALLTHROUGH;
4914  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4915  CYTHON_FALLTHROUGH;
4916  case 0: break;
4917  default: goto __pyx_L5_argtuple_error;
4918  }
4919  kw_args = PyDict_Size(__pyx_kwds);
4920  switch (pos_args) {
4921  case 0:
4922  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4923  else goto __pyx_L5_argtuple_error;
4924  CYTHON_FALLTHROUGH;
4925  case 1:
4926  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4927  else {
4928  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4929  }
4930  CYTHON_FALLTHROUGH;
4931  case 2:
4932  if (kw_args > 0) {
4933  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4934  if (value) { values[2] = value; kw_args--; }
4935  }
4936  }
4937  if (unlikely(kw_args > 0)) {
4938  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4939  }
4940  } else {
4941  switch (PyTuple_GET_SIZE(__pyx_args)) {
4942  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4943  CYTHON_FALLTHROUGH;
4944  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4945  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4946  break;
4947  default: goto __pyx_L5_argtuple_error;
4948  }
4949  }
4950  __pyx_v_x = values[0];
4951  __pyx_v_t = values[1];
4952  __pyx_v_n = values[2];
4953  }
4954  goto __pyx_L4_argument_unpacking_done;
4955  __pyx_L5_argtuple_error:;
4956  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4957  __pyx_L3_error:;
4958  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4959  __Pyx_RefNannyFinishContext();
4960  return NULL;
4961  __pyx_L4_argument_unpacking_done:;
4962  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4963 
4964  /* function exit code */
4965  __Pyx_RefNannyFinishContext();
4966  return __pyx_r;
4967 }
4968 
4969 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4970  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4971  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4972  PyObject *__pyx_r = NULL;
4973  __Pyx_TraceDeclarations
4974  __Pyx_RefNannyDeclarations
4975  int __pyx_lineno = 0;
4976  const char *__pyx_filename = NULL;
4977  int __pyx_clineno = 0;
4978  __Pyx_RefNannySetupContext("lambda", 0);
4979  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4980  __pyx_cur_scope = __pyx_outer_scope;
4981  __Pyx_TraceCall("lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4982  __Pyx_XDECREF(__pyx_r);
4983  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4984  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4985  __pyx_r = __pyx_cur_scope->__pyx_v_value;
4986  goto __pyx_L0;
4987 
4988  /* function exit code */
4989  __pyx_L1_error:;
4990  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4991  __pyx_r = NULL;
4992  __pyx_L0:;
4993  __Pyx_XGIVEREF(__pyx_r);
4994  __Pyx_TraceReturn(__pyx_r, 0);
4995  __Pyx_RefNannyFinishContext();
4996  return __pyx_r;
4997 }
4998 
4999 /* "BoundaryConditions.py":87
5000  * self.uOfXT = None
5001  *
5002  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5003  * """
5004  * function returning constant BC
5005  */
5006 
5007 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5008  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5009  PyObject *__pyx_r = NULL;
5010  __Pyx_TraceDeclarations
5011  __Pyx_RefNannyDeclarations
5012  PyObject *__pyx_t_1 = NULL;
5013  PyObject *__pyx_t_2 = NULL;
5014  PyObject *__pyx_t_3 = NULL;
5015  PyObject *__pyx_t_4 = NULL;
5016  int __pyx_lineno = 0;
5017  const char *__pyx_filename = NULL;
5018  int __pyx_clineno = 0;
5019  __Pyx_TraceFrameInit(__pyx_codeobj__6)
5020  __Pyx_RefNannySetupContext("setConstantBC", 0);
5021  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5022  if (unlikely(!__pyx_cur_scope)) {
5023  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5024  __Pyx_INCREF(Py_None);
5025  __PYX_ERR(0, 87, __pyx_L1_error)
5026  } else {
5027  __Pyx_GOTREF(__pyx_cur_scope);
5028  }
5029  __Pyx_TraceCall("setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5030  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5031  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5032  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5033 
5034  /* "BoundaryConditions.py":97
5035  *
5036  * """
5037  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
5038  *
5039  *
5040  */
5041  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5042  __Pyx_GOTREF(__pyx_t_1);
5043  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5044  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5045  __Pyx_GOTREF(__pyx_t_3);
5046  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5047  __Pyx_GOTREF(__pyx_t_4);
5048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5049  __pyx_t_3 = NULL;
5050  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5051  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5052  if (likely(__pyx_t_3)) {
5053  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5054  __Pyx_INCREF(__pyx_t_3);
5055  __Pyx_INCREF(function);
5056  __Pyx_DECREF_SET(__pyx_t_4, function);
5057  }
5058  }
5059  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5060  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5061  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5062  __Pyx_GOTREF(__pyx_t_2);
5063  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5064  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5065  __Pyx_GIVEREF(__pyx_t_2);
5066  __pyx_t_2 = 0;
5067  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5068  __Pyx_GIVEREF(__pyx_t_1);
5069  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5070  __Pyx_DECREF(__pyx_v_self->uOfXT);
5071  __pyx_v_self->uOfXT = __pyx_t_1;
5072  __pyx_t_1 = 0;
5073 
5074  /* "BoundaryConditions.py":87
5075  * self.uOfXT = None
5076  *
5077  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5078  * """
5079  * function returning constant BC
5080  */
5081 
5082  /* function exit code */
5083  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5084  goto __pyx_L0;
5085  __pyx_L1_error:;
5086  __Pyx_XDECREF(__pyx_t_1);
5087  __Pyx_XDECREF(__pyx_t_2);
5088  __Pyx_XDECREF(__pyx_t_3);
5089  __Pyx_XDECREF(__pyx_t_4);
5090  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5091  __pyx_r = NULL;
5092  __pyx_L0:;
5093  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5094  __Pyx_XGIVEREF(__pyx_r);
5095  __Pyx_TraceReturn(__pyx_r, 0);
5096  __Pyx_RefNannyFinishContext();
5097  return __pyx_r;
5098 }
5099 
5100 /* "BoundaryConditions.py":100
5101  *
5102  *
5103  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5104  * """
5105  * function returning value=a0+ax*x+ay*y+az*z
5106  */
5107 
5108 /* Python wrapper */
5109 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5110 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] = "BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5111 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5112 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5113  PyObject *__pyx_v_a0 = 0;
5114  PyObject *__pyx_v_a = 0;
5115  int __pyx_lineno = 0;
5116  const char *__pyx_filename = NULL;
5117  int __pyx_clineno = 0;
5118  PyObject *__pyx_r = 0;
5119  __Pyx_RefNannyDeclarations
5120  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
5121  {
5122  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5123  PyObject* values[2] = {0,0};
5124  if (unlikely(__pyx_kwds)) {
5125  Py_ssize_t kw_args;
5126  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5127  switch (pos_args) {
5128  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5129  CYTHON_FALLTHROUGH;
5130  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5131  CYTHON_FALLTHROUGH;
5132  case 0: break;
5133  default: goto __pyx_L5_argtuple_error;
5134  }
5135  kw_args = PyDict_Size(__pyx_kwds);
5136  switch (pos_args) {
5137  case 0:
5138  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5139  else goto __pyx_L5_argtuple_error;
5140  CYTHON_FALLTHROUGH;
5141  case 1:
5142  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5143  else {
5144  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5145  }
5146  }
5147  if (unlikely(kw_args > 0)) {
5148  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5149  }
5150  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5151  goto __pyx_L5_argtuple_error;
5152  } else {
5153  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5154  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5155  }
5156  __pyx_v_a0 = values[0];
5157  __pyx_v_a = values[1];
5158  }
5159  goto __pyx_L4_argument_unpacking_done;
5160  __pyx_L5_argtuple_error:;
5161  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5162  __pyx_L3_error:;
5163  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5164  __Pyx_RefNannyFinishContext();
5165  return NULL;
5166  __pyx_L4_argument_unpacking_done:;
5167  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5168 
5169  /* function exit code */
5170  __Pyx_RefNannyFinishContext();
5171  return __pyx_r;
5172 }
5173 
5174 /* "BoundaryConditions.py":113
5175  * """
5176  *
5177  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5178  *
5179  * def setLinearRamp(self,t1,value):
5180  */
5181 
5182 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5183  PyObject *__pyx_r = NULL;
5184  __Pyx_TraceDeclarations
5185  __Pyx_RefNannyDeclarations
5186  PyObject *__pyx_t_1 = NULL;
5187  PyObject *__pyx_t_2 = NULL;
5188  int __pyx_lineno = 0;
5189  const char *__pyx_filename = NULL;
5190  int __pyx_clineno = 0;
5191  __Pyx_RefNannySetupContext("__defaults__", 0);
5192  __Pyx_TraceCall("__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5193  __Pyx_XDECREF(__pyx_r);
5194  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5195  __Pyx_GOTREF(__pyx_t_1);
5196  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5197  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5198  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5199  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5200  __Pyx_GOTREF(__pyx_t_2);
5201  __Pyx_GIVEREF(__pyx_t_1);
5202  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5203  __Pyx_INCREF(Py_None);
5204  __Pyx_GIVEREF(Py_None);
5205  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5206  __pyx_t_1 = 0;
5207  __pyx_r = __pyx_t_2;
5208  __pyx_t_2 = 0;
5209  goto __pyx_L0;
5210 
5211  /* function exit code */
5212  __pyx_L1_error:;
5213  __Pyx_XDECREF(__pyx_t_1);
5214  __Pyx_XDECREF(__pyx_t_2);
5215  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5216  __pyx_r = NULL;
5217  __pyx_L0:;
5218  __Pyx_XGIVEREF(__pyx_r);
5219  __Pyx_TraceReturn(__pyx_r, 0);
5220  __Pyx_RefNannyFinishContext();
5221  return __pyx_r;
5222 }
5223 
5224 /* Python wrapper */
5225 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5226 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5227 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5228  PyObject *__pyx_v_x = 0;
5229  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5230  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5231  int __pyx_lineno = 0;
5232  const char *__pyx_filename = NULL;
5233  int __pyx_clineno = 0;
5234  PyObject *__pyx_r = 0;
5235  __Pyx_RefNannyDeclarations
5236  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
5237  {
5238  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5239  PyObject* values[3] = {0,0,0};
5240  __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5241  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5242  if (unlikely(__pyx_kwds)) {
5243  Py_ssize_t kw_args;
5244  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5245  switch (pos_args) {
5246  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5247  CYTHON_FALLTHROUGH;
5248  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5249  CYTHON_FALLTHROUGH;
5250  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5251  CYTHON_FALLTHROUGH;
5252  case 0: break;
5253  default: goto __pyx_L5_argtuple_error;
5254  }
5255  kw_args = PyDict_Size(__pyx_kwds);
5256  switch (pos_args) {
5257  case 0:
5258  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5259  else goto __pyx_L5_argtuple_error;
5260  CYTHON_FALLTHROUGH;
5261  case 1:
5262  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5263  else {
5264  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5265  }
5266  CYTHON_FALLTHROUGH;
5267  case 2:
5268  if (kw_args > 0) {
5269  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5270  if (value) { values[2] = value; kw_args--; }
5271  }
5272  }
5273  if (unlikely(kw_args > 0)) {
5274  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5275  }
5276  } else {
5277  switch (PyTuple_GET_SIZE(__pyx_args)) {
5278  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5279  CYTHON_FALLTHROUGH;
5280  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5281  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5282  break;
5283  default: goto __pyx_L5_argtuple_error;
5284  }
5285  }
5286  __pyx_v_x = values[0];
5287  __pyx_v_t = values[1];
5288  __pyx_v_n = values[2];
5289  }
5290  goto __pyx_L4_argument_unpacking_done;
5291  __pyx_L5_argtuple_error:;
5292  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5293  __pyx_L3_error:;
5294  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5295  __Pyx_RefNannyFinishContext();
5296  return NULL;
5297  __pyx_L4_argument_unpacking_done:;
5298  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5299 
5300  /* function exit code */
5301  __Pyx_RefNannyFinishContext();
5302  return __pyx_r;
5303 }
5304 
5305 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5306  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5307  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5308  PyObject *__pyx_r = NULL;
5309  __Pyx_TraceDeclarations
5310  __Pyx_RefNannyDeclarations
5311  PyObject *__pyx_t_1 = NULL;
5312  PyObject *__pyx_t_2 = NULL;
5313  PyObject *__pyx_t_3 = NULL;
5314  int __pyx_lineno = 0;
5315  const char *__pyx_filename = NULL;
5316  int __pyx_clineno = 0;
5317  __Pyx_RefNannySetupContext("lambda1", 0);
5318  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5319  __pyx_cur_scope = __pyx_outer_scope;
5320  __Pyx_TraceCall("lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5321  __Pyx_XDECREF(__pyx_r);
5322  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5323  if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5324  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5325  __Pyx_GOTREF(__pyx_t_1);
5326  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5327  __Pyx_GOTREF(__pyx_t_2);
5328  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5329  __Pyx_GOTREF(__pyx_t_3);
5330  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5331  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5332  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5333  __Pyx_GOTREF(__pyx_t_2);
5334  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5335  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5336  __Pyx_GOTREF(__pyx_t_3);
5337  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5338  __pyx_r = __pyx_t_3;
5339  __pyx_t_3 = 0;
5340  goto __pyx_L0;
5341 
5342  /* function exit code */
5343  __pyx_L1_error:;
5344  __Pyx_XDECREF(__pyx_t_1);
5345  __Pyx_XDECREF(__pyx_t_2);
5346  __Pyx_XDECREF(__pyx_t_3);
5347  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5348  __pyx_r = NULL;
5349  __pyx_L0:;
5350  __Pyx_XGIVEREF(__pyx_r);
5351  __Pyx_TraceReturn(__pyx_r, 0);
5352  __Pyx_RefNannyFinishContext();
5353  return __pyx_r;
5354 }
5355 
5356 /* "BoundaryConditions.py":100
5357  *
5358  *
5359  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5360  * """
5361  * function returning value=a0+ax*x+ay*y+az*z
5362  */
5363 
5364 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5365  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5366  PyObject *__pyx_r = NULL;
5367  __Pyx_TraceDeclarations
5368  __Pyx_RefNannyDeclarations
5369  PyObject *__pyx_t_1 = NULL;
5370  PyObject *__pyx_t_2 = NULL;
5371  PyObject *__pyx_t_3 = NULL;
5372  PyObject *__pyx_t_4 = NULL;
5373  int __pyx_lineno = 0;
5374  const char *__pyx_filename = NULL;
5375  int __pyx_clineno = 0;
5376  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5377  __Pyx_RefNannySetupContext("setLinearBC", 0);
5378  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5379  if (unlikely(!__pyx_cur_scope)) {
5380  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5381  __Pyx_INCREF(Py_None);
5382  __PYX_ERR(0, 100, __pyx_L1_error)
5383  } else {
5384  __Pyx_GOTREF(__pyx_cur_scope);
5385  }
5386  __Pyx_TraceCall("setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5387  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5388  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5389  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5390  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5391  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5392  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5393 
5394  /* "BoundaryConditions.py":113
5395  * """
5396  *
5397  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5398  *
5399  * def setLinearRamp(self,t1,value):
5400  */
5401  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5402  __Pyx_GOTREF(__pyx_t_1);
5403  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5404  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5405  __Pyx_GOTREF(__pyx_t_3);
5406  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5407  __Pyx_GOTREF(__pyx_t_4);
5408  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5409  __pyx_t_3 = NULL;
5410  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5411  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5412  if (likely(__pyx_t_3)) {
5413  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5414  __Pyx_INCREF(__pyx_t_3);
5415  __Pyx_INCREF(function);
5416  __Pyx_DECREF_SET(__pyx_t_4, function);
5417  }
5418  }
5419  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5420  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5421  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5422  __Pyx_GOTREF(__pyx_t_2);
5423  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5424  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5425  __Pyx_GIVEREF(__pyx_t_2);
5426  __pyx_t_2 = 0;
5427  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5428  __Pyx_GIVEREF(__pyx_t_1);
5429  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5430  __Pyx_DECREF(__pyx_v_self->uOfXT);
5431  __pyx_v_self->uOfXT = __pyx_t_1;
5432  __pyx_t_1 = 0;
5433 
5434  /* "BoundaryConditions.py":100
5435  *
5436  *
5437  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5438  * """
5439  * function returning value=a0+ax*x+ay*y+az*z
5440  */
5441 
5442  /* function exit code */
5443  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5444  goto __pyx_L0;
5445  __pyx_L1_error:;
5446  __Pyx_XDECREF(__pyx_t_1);
5447  __Pyx_XDECREF(__pyx_t_2);
5448  __Pyx_XDECREF(__pyx_t_3);
5449  __Pyx_XDECREF(__pyx_t_4);
5450  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5451  __pyx_r = NULL;
5452  __pyx_L0:;
5453  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5454  __Pyx_XGIVEREF(__pyx_r);
5455  __Pyx_TraceReturn(__pyx_r, 0);
5456  __Pyx_RefNannyFinishContext();
5457  return __pyx_r;
5458 }
5459 
5460 /* "BoundaryConditions.py":115
5461  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5462  *
5463  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5464  * """
5465  * function setting a linear ramp from t=0 to t=t1
5466  */
5467 
5468 /* Python wrapper */
5469 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5470 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] = "BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5471 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5472 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5473  PyObject *__pyx_v_t1 = 0;
5474  PyObject *__pyx_v_value = 0;
5475  int __pyx_lineno = 0;
5476  const char *__pyx_filename = NULL;
5477  int __pyx_clineno = 0;
5478  PyObject *__pyx_r = 0;
5479  __Pyx_RefNannyDeclarations
5480  __Pyx_RefNannySetupContext("setLinearRamp (wrapper)", 0);
5481  {
5482  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5483  PyObject* values[2] = {0,0};
5484  if (unlikely(__pyx_kwds)) {
5485  Py_ssize_t kw_args;
5486  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5487  switch (pos_args) {
5488  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5489  CYTHON_FALLTHROUGH;
5490  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5491  CYTHON_FALLTHROUGH;
5492  case 0: break;
5493  default: goto __pyx_L5_argtuple_error;
5494  }
5495  kw_args = PyDict_Size(__pyx_kwds);
5496  switch (pos_args) {
5497  case 0:
5498  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5499  else goto __pyx_L5_argtuple_error;
5500  CYTHON_FALLTHROUGH;
5501  case 1:
5502  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5503  else {
5504  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5505  }
5506  }
5507  if (unlikely(kw_args > 0)) {
5508  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5509  }
5510  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5511  goto __pyx_L5_argtuple_error;
5512  } else {
5513  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5514  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5515  }
5516  __pyx_v_t1 = values[0];
5517  __pyx_v_value = values[1];
5518  }
5519  goto __pyx_L4_argument_unpacking_done;
5520  __pyx_L5_argtuple_error:;
5521  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5522  __pyx_L3_error:;
5523  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5524  __Pyx_RefNannyFinishContext();
5525  return NULL;
5526  __pyx_L4_argument_unpacking_done:;
5527  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5528 
5529  /* function exit code */
5530  __Pyx_RefNannyFinishContext();
5531  return __pyx_r;
5532 }
5533 
5534 /* "BoundaryConditions.py":126
5535  * Variable value
5536  * """
5537  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5538  */
5539 
5540 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5541  PyObject *__pyx_r = NULL;
5542  __Pyx_TraceDeclarations
5543  __Pyx_RefNannyDeclarations
5544  PyObject *__pyx_t_1 = NULL;
5545  PyObject *__pyx_t_2 = NULL;
5546  int __pyx_lineno = 0;
5547  const char *__pyx_filename = NULL;
5548  int __pyx_clineno = 0;
5549  __Pyx_RefNannySetupContext("__defaults__", 0);
5550  __Pyx_TraceCall("__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5551  __Pyx_XDECREF(__pyx_r);
5552  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5553  __Pyx_GOTREF(__pyx_t_1);
5554  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5555  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5556  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5557  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5558  __Pyx_GOTREF(__pyx_t_2);
5559  __Pyx_GIVEREF(__pyx_t_1);
5560  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5561  __Pyx_INCREF(Py_None);
5562  __Pyx_GIVEREF(Py_None);
5563  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5564  __pyx_t_1 = 0;
5565  __pyx_r = __pyx_t_2;
5566  __pyx_t_2 = 0;
5567  goto __pyx_L0;
5568 
5569  /* function exit code */
5570  __pyx_L1_error:;
5571  __Pyx_XDECREF(__pyx_t_1);
5572  __Pyx_XDECREF(__pyx_t_2);
5573  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5574  __pyx_r = NULL;
5575  __pyx_L0:;
5576  __Pyx_XGIVEREF(__pyx_r);
5577  __Pyx_TraceReturn(__pyx_r, 0);
5578  __Pyx_RefNannyFinishContext();
5579  return __pyx_r;
5580 }
5581 
5582 /* Python wrapper */
5583 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5584 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5585 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5586  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5587  PyObject *__pyx_v_t = 0;
5588  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5589  int __pyx_lineno = 0;
5590  const char *__pyx_filename = NULL;
5591  int __pyx_clineno = 0;
5592  PyObject *__pyx_r = 0;
5593  __Pyx_RefNannyDeclarations
5594  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
5595  {
5596  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5597  PyObject* values[3] = {0,0,0};
5598  __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5599  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5600  if (unlikely(__pyx_kwds)) {
5601  Py_ssize_t kw_args;
5602  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5603  switch (pos_args) {
5604  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5605  CYTHON_FALLTHROUGH;
5606  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5607  CYTHON_FALLTHROUGH;
5608  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5609  CYTHON_FALLTHROUGH;
5610  case 0: break;
5611  default: goto __pyx_L5_argtuple_error;
5612  }
5613  kw_args = PyDict_Size(__pyx_kwds);
5614  switch (pos_args) {
5615  case 0:
5616  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5617  else goto __pyx_L5_argtuple_error;
5618  CYTHON_FALLTHROUGH;
5619  case 1:
5620  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5621  else {
5622  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5623  }
5624  CYTHON_FALLTHROUGH;
5625  case 2:
5626  if (kw_args > 0) {
5627  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5628  if (value) { values[2] = value; kw_args--; }
5629  }
5630  }
5631  if (unlikely(kw_args > 0)) {
5632  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5633  }
5634  } else {
5635  switch (PyTuple_GET_SIZE(__pyx_args)) {
5636  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5637  CYTHON_FALLTHROUGH;
5638  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5639  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5640  break;
5641  default: goto __pyx_L5_argtuple_error;
5642  }
5643  }
5644  __pyx_v_x = values[0];
5645  __pyx_v_t = values[1];
5646  __pyx_v_n = values[2];
5647  }
5648  goto __pyx_L4_argument_unpacking_done;
5649  __pyx_L5_argtuple_error:;
5650  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5651  __pyx_L3_error:;
5652  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5653  __Pyx_RefNannyFinishContext();
5654  return NULL;
5655  __pyx_L4_argument_unpacking_done:;
5656  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5657 
5658  /* function exit code */
5659  __Pyx_RefNannyFinishContext();
5660  return __pyx_r;
5661 }
5662 
5663 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5664  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5665  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5666  PyObject *__pyx_r = NULL;
5667  __Pyx_TraceDeclarations
5668  __Pyx_RefNannyDeclarations
5669  long __pyx_t_1;
5670  PyObject *__pyx_t_2 = NULL;
5671  PyObject *__pyx_t_3 = NULL;
5672  PyObject *__pyx_t_4 = NULL;
5673  PyObject *__pyx_t_5 = NULL;
5674  int __pyx_t_6;
5675  int __pyx_lineno = 0;
5676  const char *__pyx_filename = NULL;
5677  int __pyx_clineno = 0;
5678  __Pyx_RefNannySetupContext("lambda2", 0);
5679  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5680  __pyx_cur_scope = __pyx_outer_scope;
5681  __Pyx_TraceCall("lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5682  __Pyx_XDECREF(__pyx_r);
5683  __pyx_t_1 = 1;
5684  if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError("t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5685  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5686  __Pyx_GOTREF(__pyx_t_2);
5687  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5688  __Pyx_GOTREF(__pyx_t_4);
5689  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5690  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5691  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5692  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5693  if (__pyx_t_6) {
5694  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5695  __Pyx_GOTREF(__pyx_t_5);
5696  __pyx_t_3 = __pyx_t_5;
5697  __pyx_t_5 = 0;
5698  } else {
5699  __Pyx_INCREF(__pyx_t_2);
5700  __pyx_t_3 = __pyx_t_2;
5701  }
5702  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5703  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5704  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5705  __Pyx_GOTREF(__pyx_t_2);
5706  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5707  __pyx_r = __pyx_t_2;
5708  __pyx_t_2 = 0;
5709  goto __pyx_L0;
5710 
5711  /* function exit code */
5712  __pyx_L1_error:;
5713  __Pyx_XDECREF(__pyx_t_2);
5714  __Pyx_XDECREF(__pyx_t_3);
5715  __Pyx_XDECREF(__pyx_t_4);
5716  __Pyx_XDECREF(__pyx_t_5);
5717  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5718  __pyx_r = NULL;
5719  __pyx_L0:;
5720  __Pyx_XGIVEREF(__pyx_r);
5721  __Pyx_TraceReturn(__pyx_r, 0);
5722  __Pyx_RefNannyFinishContext();
5723  return __pyx_r;
5724 }
5725 
5726 /* "BoundaryConditions.py":115
5727  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5728  *
5729  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5730  * """
5731  * function setting a linear ramp from t=0 to t=t1
5732  */
5733 
5734 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5735  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5736  PyObject *__pyx_r = NULL;
5737  __Pyx_TraceDeclarations
5738  __Pyx_RefNannyDeclarations
5739  PyObject *__pyx_t_1 = NULL;
5740  PyObject *__pyx_t_2 = NULL;
5741  PyObject *__pyx_t_3 = NULL;
5742  PyObject *__pyx_t_4 = NULL;
5743  int __pyx_lineno = 0;
5744  const char *__pyx_filename = NULL;
5745  int __pyx_clineno = 0;
5746  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5747  __Pyx_RefNannySetupContext("setLinearRamp", 0);
5748  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5749  if (unlikely(!__pyx_cur_scope)) {
5750  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5751  __Pyx_INCREF(Py_None);
5752  __PYX_ERR(0, 115, __pyx_L1_error)
5753  } else {
5754  __Pyx_GOTREF(__pyx_cur_scope);
5755  }
5756  __Pyx_TraceCall("setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5757  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5758  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5759  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5760  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5761  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5762  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5763 
5764  /* "BoundaryConditions.py":126
5765  * Variable value
5766  * """
5767  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5768  */
5769  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5770  __Pyx_GOTREF(__pyx_t_1);
5771  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5772  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5773  __Pyx_GOTREF(__pyx_t_3);
5774  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5775  __Pyx_GOTREF(__pyx_t_4);
5776  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5777  __pyx_t_3 = NULL;
5778  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5779  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5780  if (likely(__pyx_t_3)) {
5781  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5782  __Pyx_INCREF(__pyx_t_3);
5783  __Pyx_INCREF(function);
5784  __Pyx_DECREF_SET(__pyx_t_4, function);
5785  }
5786  }
5787  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5788  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5789  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5790  __Pyx_GOTREF(__pyx_t_2);
5791  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5793  __Pyx_GIVEREF(__pyx_t_2);
5794  __pyx_t_2 = 0;
5795  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5796  __Pyx_GIVEREF(__pyx_t_1);
5797  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5798  __Pyx_DECREF(__pyx_v_self->uOfXT);
5799  __pyx_v_self->uOfXT = __pyx_t_1;
5800  __pyx_t_1 = 0;
5801 
5802  /* "BoundaryConditions.py":115
5803  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5804  *
5805  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5806  * """
5807  * function setting a linear ramp from t=0 to t=t1
5808  */
5809 
5810  /* function exit code */
5811  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5812  goto __pyx_L0;
5813  __pyx_L1_error:;
5814  __Pyx_XDECREF(__pyx_t_1);
5815  __Pyx_XDECREF(__pyx_t_2);
5816  __Pyx_XDECREF(__pyx_t_3);
5817  __Pyx_XDECREF(__pyx_t_4);
5818  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5819  __pyx_r = NULL;
5820  __pyx_L0:;
5821  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5822  __Pyx_XGIVEREF(__pyx_r);
5823  __Pyx_TraceReturn(__pyx_r, 0);
5824  __Pyx_RefNannyFinishContext();
5825  return __pyx_r;
5826 }
5827 
5828 /* "BoundaryConditions.pxd":20
5829  * cdef cpp_uOfXT uuOfXT
5830  * cdef public:
5831  * object uOfXT # <<<<<<<<<<<<<<
5832  * cpdef void resetBC(self)
5833  * # cpdef void setConstantBC(self, double value)
5834  */
5835 
5836 /* Python wrapper */
5837 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
5838 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5839  PyObject *__pyx_r = 0;
5840  __Pyx_RefNannyDeclarations
5841  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5842  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5843 
5844  /* function exit code */
5845  __Pyx_RefNannyFinishContext();
5846  return __pyx_r;
5847 }
5848 
5849 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5850  PyObject *__pyx_r = NULL;
5851  __Pyx_TraceDeclarations
5852  __Pyx_RefNannyDeclarations
5853  int __pyx_lineno = 0;
5854  const char *__pyx_filename = NULL;
5855  int __pyx_clineno = 0;
5856  __Pyx_RefNannySetupContext("__get__", 0);
5857  __Pyx_TraceCall("__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5858  __Pyx_XDECREF(__pyx_r);
5859  __Pyx_INCREF(__pyx_v_self->uOfXT);
5860  __pyx_r = __pyx_v_self->uOfXT;
5861  goto __pyx_L0;
5862 
5863  /* function exit code */
5864  __pyx_L1_error:;
5865  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5866  __pyx_r = NULL;
5867  __pyx_L0:;
5868  __Pyx_XGIVEREF(__pyx_r);
5869  __Pyx_TraceReturn(__pyx_r, 0);
5870  __Pyx_RefNannyFinishContext();
5871  return __pyx_r;
5872 }
5873 
5874 /* Python wrapper */
5875 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5876 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5877  int __pyx_r;
5878  __Pyx_RefNannyDeclarations
5879  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5880  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5881 
5882  /* function exit code */
5883  __Pyx_RefNannyFinishContext();
5884  return __pyx_r;
5885 }
5886 
5887 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5888  int __pyx_r;
5889  __Pyx_TraceDeclarations
5890  __Pyx_RefNannyDeclarations
5891  int __pyx_lineno = 0;
5892  const char *__pyx_filename = NULL;
5893  int __pyx_clineno = 0;
5894  __Pyx_RefNannySetupContext("__set__", 0);
5895  __Pyx_TraceCall("__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5896  __Pyx_INCREF(__pyx_v_value);
5897  __Pyx_GIVEREF(__pyx_v_value);
5898  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5899  __Pyx_DECREF(__pyx_v_self->uOfXT);
5900  __pyx_v_self->uOfXT = __pyx_v_value;
5901 
5902  /* function exit code */
5903  __pyx_r = 0;
5904  goto __pyx_L0;
5905  __pyx_L1_error:;
5906  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5907  __pyx_r = -1;
5908  __pyx_L0:;
5909  __Pyx_TraceReturn(Py_None, 0);
5910  __Pyx_RefNannyFinishContext();
5911  return __pyx_r;
5912 }
5913 
5914 /* Python wrapper */
5915 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
5916 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5917  int __pyx_r;
5918  __Pyx_RefNannyDeclarations
5919  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5920  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5921 
5922  /* function exit code */
5923  __Pyx_RefNannyFinishContext();
5924  return __pyx_r;
5925 }
5926 
5927 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5928  int __pyx_r;
5929  __Pyx_TraceDeclarations
5930  __Pyx_RefNannyDeclarations
5931  int __pyx_lineno = 0;
5932  const char *__pyx_filename = NULL;
5933  int __pyx_clineno = 0;
5934  __Pyx_RefNannySetupContext("__del__", 0);
5935  __Pyx_TraceCall("__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5936  __Pyx_INCREF(Py_None);
5937  __Pyx_GIVEREF(Py_None);
5938  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5939  __Pyx_DECREF(__pyx_v_self->uOfXT);
5940  __pyx_v_self->uOfXT = Py_None;
5941 
5942  /* function exit code */
5943  __pyx_r = 0;
5944  goto __pyx_L0;
5945  __pyx_L1_error:;
5946  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5947  __pyx_r = -1;
5948  __pyx_L0:;
5949  __Pyx_TraceReturn(Py_None, 0);
5950  __Pyx_RefNannyFinishContext();
5951  return __pyx_r;
5952 }
5953 
5954 /* "(tree fragment)":1
5955  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5956  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5957  * def __setstate_cython__(self, __pyx_state):
5958  */
5959 
5960 /* Python wrapper */
5961 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5962 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] = "BoundaryCondition.__reduce_cython__(self)";
5963 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5964 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5965  PyObject *__pyx_r = 0;
5966  __Pyx_RefNannyDeclarations
5967  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5968  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5969 
5970  /* function exit code */
5971  __Pyx_RefNannyFinishContext();
5972  return __pyx_r;
5973 }
5974 
5975 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5976  PyObject *__pyx_r = NULL;
5977  __Pyx_TraceDeclarations
5978  __Pyx_RefNannyDeclarations
5979  PyObject *__pyx_t_1 = NULL;
5980  int __pyx_lineno = 0;
5981  const char *__pyx_filename = NULL;
5982  int __pyx_clineno = 0;
5983  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5984  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5985  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
5986 
5987  /* "(tree fragment)":2
5988  * def __reduce_cython__(self):
5989  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5990  * def __setstate_cython__(self, __pyx_state):
5991  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5992  */
5993  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5994  __Pyx_GOTREF(__pyx_t_1);
5995  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5996  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5997  __PYX_ERR(1, 2, __pyx_L1_error)
5998 
5999  /* "(tree fragment)":1
6000  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6001  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6002  * def __setstate_cython__(self, __pyx_state):
6003  */
6004 
6005  /* function exit code */
6006  __pyx_L1_error:;
6007  __Pyx_XDECREF(__pyx_t_1);
6008  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6009  __pyx_r = NULL;
6010  __Pyx_XGIVEREF(__pyx_r);
6011  __Pyx_TraceReturn(__pyx_r, 0);
6012  __Pyx_RefNannyFinishContext();
6013  return __pyx_r;
6014 }
6015 
6016 /* "(tree fragment)":3
6017  * def __reduce_cython__(self):
6018  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6019  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6020  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6021  */
6022 
6023 /* Python wrapper */
6024 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6025 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] = "BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6026 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6027 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6028  PyObject *__pyx_r = 0;
6029  __Pyx_RefNannyDeclarations
6030  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6031  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6032 
6033  /* function exit code */
6034  __Pyx_RefNannyFinishContext();
6035  return __pyx_r;
6036 }
6037 
6038 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6039  PyObject *__pyx_r = NULL;
6040  __Pyx_TraceDeclarations
6041  __Pyx_RefNannyDeclarations
6042  PyObject *__pyx_t_1 = NULL;
6043  int __pyx_lineno = 0;
6044  const char *__pyx_filename = NULL;
6045  int __pyx_clineno = 0;
6046  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6047  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6048  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6049 
6050  /* "(tree fragment)":4
6051  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6052  * def __setstate_cython__(self, __pyx_state):
6053  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6054  */
6055  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6056  __Pyx_GOTREF(__pyx_t_1);
6057  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6059  __PYX_ERR(1, 4, __pyx_L1_error)
6060 
6061  /* "(tree fragment)":3
6062  * def __reduce_cython__(self):
6063  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6064  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6065  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6066  */
6067 
6068  /* function exit code */
6069  __pyx_L1_error:;
6070  __Pyx_XDECREF(__pyx_t_1);
6071  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6072  __pyx_r = NULL;
6073  __Pyx_XGIVEREF(__pyx_r);
6074  __Pyx_TraceReturn(__pyx_r, 0);
6075  __Pyx_RefNannyFinishContext();
6076  return __pyx_r;
6077 }
6078 
6079 /* "(tree fragment)":1
6080  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6081  * cdef object __pyx_PickleError
6082  * cdef object __pyx_result
6083  */
6084 
6085 /* Python wrapper */
6086 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6087 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6088 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6089 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6090  PyObject *__pyx_v___pyx_type = 0;
6091  long __pyx_v___pyx_checksum;
6092  PyObject *__pyx_v___pyx_state = 0;
6093  int __pyx_lineno = 0;
6094  const char *__pyx_filename = NULL;
6095  int __pyx_clineno = 0;
6096  PyObject *__pyx_r = 0;
6097  __Pyx_RefNannyDeclarations
6098  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
6099  {
6100  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6101  PyObject* values[3] = {0,0,0};
6102  if (unlikely(__pyx_kwds)) {
6103  Py_ssize_t kw_args;
6104  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6105  switch (pos_args) {
6106  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6107  CYTHON_FALLTHROUGH;
6108  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6109  CYTHON_FALLTHROUGH;
6110  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6111  CYTHON_FALLTHROUGH;
6112  case 0: break;
6113  default: goto __pyx_L5_argtuple_error;
6114  }
6115  kw_args = PyDict_Size(__pyx_kwds);
6116  switch (pos_args) {
6117  case 0:
6118  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6119  else goto __pyx_L5_argtuple_error;
6120  CYTHON_FALLTHROUGH;
6121  case 1:
6122  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6123  else {
6124  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6125  }
6126  CYTHON_FALLTHROUGH;
6127  case 2:
6128  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6129  else {
6130  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6131  }
6132  }
6133  if (unlikely(kw_args > 0)) {
6134  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6135  }
6136  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6137  goto __pyx_L5_argtuple_error;
6138  } else {
6139  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6140  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6141  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6142  }
6143  __pyx_v___pyx_type = values[0];
6144  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6145  __pyx_v___pyx_state = values[2];
6146  }
6147  goto __pyx_L4_argument_unpacking_done;
6148  __pyx_L5_argtuple_error:;
6149  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6150  __pyx_L3_error:;
6151  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152  __Pyx_RefNannyFinishContext();
6153  return NULL;
6154  __pyx_L4_argument_unpacking_done:;
6155  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6156 
6157  /* function exit code */
6158  __Pyx_RefNannyFinishContext();
6159  return __pyx_r;
6160 }
6161 
6162 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6163  PyObject *__pyx_v___pyx_PickleError = 0;
6164  PyObject *__pyx_v___pyx_result = 0;
6165  PyObject *__pyx_r = NULL;
6166  __Pyx_TraceDeclarations
6167  __Pyx_RefNannyDeclarations
6168  int __pyx_t_1;
6169  PyObject *__pyx_t_2 = NULL;
6170  PyObject *__pyx_t_3 = NULL;
6171  PyObject *__pyx_t_4 = NULL;
6172  PyObject *__pyx_t_5 = NULL;
6173  int __pyx_t_6;
6174  int __pyx_lineno = 0;
6175  const char *__pyx_filename = NULL;
6176  int __pyx_clineno = 0;
6177  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6178  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
6179  __Pyx_TraceCall("__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6180 
6181  /* "(tree fragment)":4
6182  * cdef object __pyx_PickleError
6183  * cdef object __pyx_result
6184  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6185  * from pickle import PickleError as __pyx_PickleError
6186  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6187  */
6188  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6189  if (__pyx_t_1) {
6190 
6191  /* "(tree fragment)":5
6192  * cdef object __pyx_result
6193  * if __pyx_checksum != 0x96e6a1f:
6194  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
6195  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6196  * __pyx_result = BC_Base.__new__(__pyx_type)
6197  */
6198  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6199  __Pyx_GOTREF(__pyx_t_2);
6200  __Pyx_INCREF(__pyx_n_s_PickleError);
6201  __Pyx_GIVEREF(__pyx_n_s_PickleError);
6202  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6203  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6204  __Pyx_GOTREF(__pyx_t_3);
6205  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6206  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6207  __Pyx_GOTREF(__pyx_t_2);
6208  __Pyx_INCREF(__pyx_t_2);
6209  __pyx_v___pyx_PickleError = __pyx_t_2;
6210  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6212 
6213  /* "(tree fragment)":6
6214  * if __pyx_checksum != 0x96e6a1f:
6215  * from pickle import PickleError as __pyx_PickleError
6216  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
6217  * __pyx_result = BC_Base.__new__(__pyx_type)
6218  * if __pyx_state is not None:
6219  */
6220  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6221  __Pyx_GOTREF(__pyx_t_2);
6222  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6223  __Pyx_GOTREF(__pyx_t_4);
6224  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6225  __Pyx_INCREF(__pyx_v___pyx_PickleError);
6226  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6227  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6228  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6229  if (likely(__pyx_t_5)) {
6230  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6231  __Pyx_INCREF(__pyx_t_5);
6232  __Pyx_INCREF(function);
6233  __Pyx_DECREF_SET(__pyx_t_2, function);
6234  }
6235  }
6236  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6237  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6238  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6239  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6240  __Pyx_GOTREF(__pyx_t_3);
6241  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6242  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6243  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6244  __PYX_ERR(1, 6, __pyx_L1_error)
6245 
6246  /* "(tree fragment)":4
6247  * cdef object __pyx_PickleError
6248  * cdef object __pyx_result
6249  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6250  * from pickle import PickleError as __pyx_PickleError
6251  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6252  */
6253  }
6254 
6255  /* "(tree fragment)":7
6256  * from pickle import PickleError as __pyx_PickleError
6257  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6258  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
6259  * if __pyx_state is not None:
6260  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6261  */
6262  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6263  __Pyx_GOTREF(__pyx_t_2);
6264  __pyx_t_4 = NULL;
6265  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6266  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6267  if (likely(__pyx_t_4)) {
6268  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6269  __Pyx_INCREF(__pyx_t_4);
6270  __Pyx_INCREF(function);
6271  __Pyx_DECREF_SET(__pyx_t_2, function);
6272  }
6273  }
6274  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6275  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6276  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6277  __Pyx_GOTREF(__pyx_t_3);
6278  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6279  __pyx_v___pyx_result = __pyx_t_3;
6280  __pyx_t_3 = 0;
6281 
6282  /* "(tree fragment)":8
6283  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6284  * __pyx_result = BC_Base.__new__(__pyx_type)
6285  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6286  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6287  * return __pyx_result
6288  */
6289  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6290  __pyx_t_6 = (__pyx_t_1 != 0);
6291  if (__pyx_t_6) {
6292 
6293  /* "(tree fragment)":9
6294  * __pyx_result = BC_Base.__new__(__pyx_type)
6295  * if __pyx_state is not None:
6296  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
6297  * return __pyx_result
6298  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6299  */
6300  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6301  __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6302  __Pyx_GOTREF(__pyx_t_3);
6303  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6304 
6305  /* "(tree fragment)":8
6306  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6307  * __pyx_result = BC_Base.__new__(__pyx_type)
6308  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6309  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6310  * return __pyx_result
6311  */
6312  }
6313 
6314  /* "(tree fragment)":10
6315  * if __pyx_state is not None:
6316  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6317  * return __pyx_result # <<<<<<<<<<<<<<
6318  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6319  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6320  */
6321  __Pyx_XDECREF(__pyx_r);
6322  __Pyx_INCREF(__pyx_v___pyx_result);
6323  __pyx_r = __pyx_v___pyx_result;
6324  goto __pyx_L0;
6325 
6326  /* "(tree fragment)":1
6327  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6328  * cdef object __pyx_PickleError
6329  * cdef object __pyx_result
6330  */
6331 
6332  /* function exit code */
6333  __pyx_L1_error:;
6334  __Pyx_XDECREF(__pyx_t_2);
6335  __Pyx_XDECREF(__pyx_t_3);
6336  __Pyx_XDECREF(__pyx_t_4);
6337  __Pyx_XDECREF(__pyx_t_5);
6338  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6339  __pyx_r = NULL;
6340  __pyx_L0:;
6341  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6342  __Pyx_XDECREF(__pyx_v___pyx_result);
6343  __Pyx_XGIVEREF(__pyx_r);
6344  __Pyx_TraceReturn(__pyx_r, 0);
6345  __Pyx_RefNannyFinishContext();
6346  return __pyx_r;
6347 }
6348 
6349 /* "(tree fragment)":11
6350  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6351  * return __pyx_result
6352  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6353  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6354  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6355  */
6356 
6357 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6358  PyObject *__pyx_r = NULL;
6359  __Pyx_TraceDeclarations
6360  __Pyx_RefNannyDeclarations
6361  PyObject *__pyx_t_1 = NULL;
6362  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6363  int __pyx_t_3;
6364  int __pyx_t_4;
6365  Py_ssize_t __pyx_t_5;
6366  int __pyx_t_6;
6367  int __pyx_t_7;
6368  PyObject *__pyx_t_8 = NULL;
6369  PyObject *__pyx_t_9 = NULL;
6370  int __pyx_lineno = 0;
6371  const char *__pyx_filename = NULL;
6372  int __pyx_clineno = 0;
6373  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
6374  __Pyx_TraceCall("__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6375 
6376  /* "(tree fragment)":12
6377  * return __pyx_result
6378  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6379  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
6380  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6381  * __pyx_result.__dict__.update(__pyx_state[6])
6382  */
6383  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6384  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6385  __PYX_ERR(1, 12, __pyx_L1_error)
6386  }
6387  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6388  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6389  __Pyx_INCREF(__pyx_t_1);
6390  __Pyx_GIVEREF(__pyx_t_1);
6391  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6392  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6393  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6394  __pyx_t_1 = 0;
6395  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6396  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6397  __PYX_ERR(1, 12, __pyx_L1_error)
6398  }
6399  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6400  __Pyx_INCREF(__pyx_t_1);
6401  __Pyx_GIVEREF(__pyx_t_1);
6402  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6403  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6404  __pyx_v___pyx_result->Shape = __pyx_t_1;
6405  __pyx_t_1 = 0;
6406  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6407  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6408  __PYX_ERR(1, 12, __pyx_L1_error)
6409  }
6410  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6411  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6412  __pyx_v___pyx_result->_b_or = __pyx_t_2;
6413  __pyx_t_2.memview = NULL;
6414  __pyx_t_2.data = NULL;
6415  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6416  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6417  __PYX_ERR(1, 12, __pyx_L1_error)
6418  }
6419  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6420  __Pyx_INCREF(__pyx_t_1);
6421  __Pyx_GIVEREF(__pyx_t_1);
6422  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6423  __Pyx_DECREF(__pyx_v___pyx_result->ct);
6424  __pyx_v___pyx_result->ct = __pyx_t_1;
6425  __pyx_t_1 = 0;
6426  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6427  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6428  __PYX_ERR(1, 12, __pyx_L1_error)
6429  }
6430  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6431  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6432  __Pyx_INCREF(__pyx_t_1);
6433  __Pyx_GIVEREF(__pyx_t_1);
6434  __Pyx_GOTREF(__pyx_v___pyx_result->name);
6435  __Pyx_DECREF(__pyx_v___pyx_result->name);
6436  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6437  __pyx_t_1 = 0;
6438  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6439  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6440  __PYX_ERR(1, 12, __pyx_L1_error)
6441  }
6442  __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6443  __pyx_v___pyx_result->nd = __pyx_t_3;
6444 
6445  /* "(tree fragment)":13
6446  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6447  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6448  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6449  * __pyx_result.__dict__.update(__pyx_state[6])
6450  */
6451  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6452  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6453  __PYX_ERR(1, 13, __pyx_L1_error)
6454  }
6455  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6456  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6457  if (__pyx_t_6) {
6458  } else {
6459  __pyx_t_4 = __pyx_t_6;
6460  goto __pyx_L4_bool_binop_done;
6461  }
6462  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6463  __pyx_t_7 = (__pyx_t_6 != 0);
6464  __pyx_t_4 = __pyx_t_7;
6465  __pyx_L4_bool_binop_done:;
6466  if (__pyx_t_4) {
6467 
6468  /* "(tree fragment)":14
6469  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6470  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6471  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
6472  */
6473  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6474  __Pyx_GOTREF(__pyx_t_8);
6475  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6476  __Pyx_GOTREF(__pyx_t_9);
6477  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6478  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6479  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6480  __PYX_ERR(1, 14, __pyx_L1_error)
6481  }
6482  __pyx_t_8 = NULL;
6483  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6484  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6485  if (likely(__pyx_t_8)) {
6486  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6487  __Pyx_INCREF(__pyx_t_8);
6488  __Pyx_INCREF(function);
6489  __Pyx_DECREF_SET(__pyx_t_9, function);
6490  }
6491  }
6492  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6493  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6494  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6495  __Pyx_GOTREF(__pyx_t_1);
6496  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6498 
6499  /* "(tree fragment)":13
6500  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6501  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6502  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6503  * __pyx_result.__dict__.update(__pyx_state[6])
6504  */
6505  }
6506 
6507  /* "(tree fragment)":11
6508  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6509  * return __pyx_result
6510  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6511  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6512  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6513  */
6514 
6515  /* function exit code */
6516  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6517  goto __pyx_L0;
6518  __pyx_L1_error:;
6519  __Pyx_XDECREF(__pyx_t_1);
6520  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6521  __Pyx_XDECREF(__pyx_t_8);
6522  __Pyx_XDECREF(__pyx_t_9);
6523  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524  __pyx_r = 0;
6525  __pyx_L0:;
6526  __Pyx_XGIVEREF(__pyx_r);
6527  __Pyx_TraceReturn(__pyx_r, 0);
6528  __Pyx_RefNannyFinishContext();
6529  return __pyx_r;
6530 }
6531 
6532 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6533  * ctypedef npy_cdouble complex_t
6534  *
6535  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6536  * return PyArray_MultiIterNew(1, <void*>a)
6537  *
6538  */
6539 
6540 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6541  PyObject *__pyx_r = NULL;
6542  __Pyx_TraceDeclarations
6543  __Pyx_RefNannyDeclarations
6544  PyObject *__pyx_t_1 = NULL;
6545  int __pyx_lineno = 0;
6546  const char *__pyx_filename = NULL;
6547  int __pyx_clineno = 0;
6548  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6549  __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[3], 742, 0, __PYX_ERR(3, 742, __pyx_L1_error));
6550 
6551  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":743
6552  *
6553  * cdef inline object PyArray_MultiIterNew1(a):
6554  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6555  *
6556  * cdef inline object PyArray_MultiIterNew2(a, b):
6557  */
6558  __Pyx_XDECREF(__pyx_r);
6559  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 743, __pyx_L1_error)
6560  __Pyx_GOTREF(__pyx_t_1);
6561  __pyx_r = __pyx_t_1;
6562  __pyx_t_1 = 0;
6563  goto __pyx_L0;
6564 
6565  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6566  * ctypedef npy_cdouble complex_t
6567  *
6568  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6569  * return PyArray_MultiIterNew(1, <void*>a)
6570  *
6571  */
6572 
6573  /* function exit code */
6574  __pyx_L1_error:;
6575  __Pyx_XDECREF(__pyx_t_1);
6576  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6577  __pyx_r = 0;
6578  __pyx_L0:;
6579  __Pyx_XGIVEREF(__pyx_r);
6580  __Pyx_TraceReturn(__pyx_r, 0);
6581  __Pyx_RefNannyFinishContext();
6582  return __pyx_r;
6583 }
6584 
6585 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6586  * return PyArray_MultiIterNew(1, <void*>a)
6587  *
6588  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6589  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6590  *
6591  */
6592 
6593 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6594  PyObject *__pyx_r = NULL;
6595  __Pyx_TraceDeclarations
6596  __Pyx_RefNannyDeclarations
6597  PyObject *__pyx_t_1 = NULL;
6598  int __pyx_lineno = 0;
6599  const char *__pyx_filename = NULL;
6600  int __pyx_clineno = 0;
6601  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6602  __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[3], 745, 0, __PYX_ERR(3, 745, __pyx_L1_error));
6603 
6604  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":746
6605  *
6606  * cdef inline object PyArray_MultiIterNew2(a, b):
6607  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6608  *
6609  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6610  */
6611  __Pyx_XDECREF(__pyx_r);
6612  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 746, __pyx_L1_error)
6613  __Pyx_GOTREF(__pyx_t_1);
6614  __pyx_r = __pyx_t_1;
6615  __pyx_t_1 = 0;
6616  goto __pyx_L0;
6617 
6618  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6619  * return PyArray_MultiIterNew(1, <void*>a)
6620  *
6621  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6622  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6623  *
6624  */
6625 
6626  /* function exit code */
6627  __pyx_L1_error:;
6628  __Pyx_XDECREF(__pyx_t_1);
6629  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6630  __pyx_r = 0;
6631  __pyx_L0:;
6632  __Pyx_XGIVEREF(__pyx_r);
6633  __Pyx_TraceReturn(__pyx_r, 0);
6634  __Pyx_RefNannyFinishContext();
6635  return __pyx_r;
6636 }
6637 
6638 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6639  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6640  *
6641  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6642  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6643  *
6644  */
6645 
6646 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6647  PyObject *__pyx_r = NULL;
6648  __Pyx_TraceDeclarations
6649  __Pyx_RefNannyDeclarations
6650  PyObject *__pyx_t_1 = NULL;
6651  int __pyx_lineno = 0;
6652  const char *__pyx_filename = NULL;
6653  int __pyx_clineno = 0;
6654  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6655  __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[3], 748, 0, __PYX_ERR(3, 748, __pyx_L1_error));
6656 
6657  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":749
6658  *
6659  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6660  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6661  *
6662  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6663  */
6664  __Pyx_XDECREF(__pyx_r);
6665  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 749, __pyx_L1_error)
6666  __Pyx_GOTREF(__pyx_t_1);
6667  __pyx_r = __pyx_t_1;
6668  __pyx_t_1 = 0;
6669  goto __pyx_L0;
6670 
6671  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6672  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6673  *
6674  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6675  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6676  *
6677  */
6678 
6679  /* function exit code */
6680  __pyx_L1_error:;
6681  __Pyx_XDECREF(__pyx_t_1);
6682  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6683  __pyx_r = 0;
6684  __pyx_L0:;
6685  __Pyx_XGIVEREF(__pyx_r);
6686  __Pyx_TraceReturn(__pyx_r, 0);
6687  __Pyx_RefNannyFinishContext();
6688  return __pyx_r;
6689 }
6690 
6691 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6692  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6693  *
6694  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6695  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6696  *
6697  */
6698 
6699 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6700  PyObject *__pyx_r = NULL;
6701  __Pyx_TraceDeclarations
6702  __Pyx_RefNannyDeclarations
6703  PyObject *__pyx_t_1 = NULL;
6704  int __pyx_lineno = 0;
6705  const char *__pyx_filename = NULL;
6706  int __pyx_clineno = 0;
6707  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6708  __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[3], 751, 0, __PYX_ERR(3, 751, __pyx_L1_error));
6709 
6710  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":752
6711  *
6712  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6713  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6714  *
6715  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6716  */
6717  __Pyx_XDECREF(__pyx_r);
6718  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 752, __pyx_L1_error)
6719  __Pyx_GOTREF(__pyx_t_1);
6720  __pyx_r = __pyx_t_1;
6721  __pyx_t_1 = 0;
6722  goto __pyx_L0;
6723 
6724  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6725  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6726  *
6727  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6728  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6729  *
6730  */
6731 
6732  /* function exit code */
6733  __pyx_L1_error:;
6734  __Pyx_XDECREF(__pyx_t_1);
6735  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6736  __pyx_r = 0;
6737  __pyx_L0:;
6738  __Pyx_XGIVEREF(__pyx_r);
6739  __Pyx_TraceReturn(__pyx_r, 0);
6740  __Pyx_RefNannyFinishContext();
6741  return __pyx_r;
6742 }
6743 
6744 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6745  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6746  *
6747  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6748  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6749  *
6750  */
6751 
6752 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6753  PyObject *__pyx_r = NULL;
6754  __Pyx_TraceDeclarations
6755  __Pyx_RefNannyDeclarations
6756  PyObject *__pyx_t_1 = NULL;
6757  int __pyx_lineno = 0;
6758  const char *__pyx_filename = NULL;
6759  int __pyx_clineno = 0;
6760  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6761  __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[3], 754, 0, __PYX_ERR(3, 754, __pyx_L1_error));
6762 
6763  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":755
6764  *
6765  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6766  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6767  *
6768  * cdef inline tuple PyDataType_SHAPE(dtype d):
6769  */
6770  __Pyx_XDECREF(__pyx_r);
6771  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 755, __pyx_L1_error)
6772  __Pyx_GOTREF(__pyx_t_1);
6773  __pyx_r = __pyx_t_1;
6774  __pyx_t_1 = 0;
6775  goto __pyx_L0;
6776 
6777  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6778  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6779  *
6780  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6781  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6782  *
6783  */
6784 
6785  /* function exit code */
6786  __pyx_L1_error:;
6787  __Pyx_XDECREF(__pyx_t_1);
6788  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6789  __pyx_r = 0;
6790  __pyx_L0:;
6791  __Pyx_XGIVEREF(__pyx_r);
6792  __Pyx_TraceReturn(__pyx_r, 0);
6793  __Pyx_RefNannyFinishContext();
6794  return __pyx_r;
6795 }
6796 
6797 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6798  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6799  *
6800  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6801  * if PyDataType_HASSUBARRAY(d):
6802  * return <tuple>d.subarray.shape
6803  */
6804 
6805 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6806  PyObject *__pyx_r = NULL;
6807  __Pyx_TraceDeclarations
6808  __Pyx_RefNannyDeclarations
6809  int __pyx_t_1;
6810  int __pyx_lineno = 0;
6811  const char *__pyx_filename = NULL;
6812  int __pyx_clineno = 0;
6813  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6814  __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[3], 757, 0, __PYX_ERR(3, 757, __pyx_L1_error));
6815 
6816  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6817  *
6818  * cdef inline tuple PyDataType_SHAPE(dtype d):
6819  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6820  * return <tuple>d.subarray.shape
6821  * else:
6822  */
6823  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6824  if (__pyx_t_1) {
6825 
6826  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":759
6827  * cdef inline tuple PyDataType_SHAPE(dtype d):
6828  * if PyDataType_HASSUBARRAY(d):
6829  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6830  * else:
6831  * return ()
6832  */
6833  __Pyx_XDECREF(__pyx_r);
6834  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6835  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6836  goto __pyx_L0;
6837 
6838  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6839  *
6840  * cdef inline tuple PyDataType_SHAPE(dtype d):
6841  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6842  * return <tuple>d.subarray.shape
6843  * else:
6844  */
6845  }
6846 
6847  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":761
6848  * return <tuple>d.subarray.shape
6849  * else:
6850  * return () # <<<<<<<<<<<<<<
6851  *
6852  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6853  */
6854  /*else*/ {
6855  __Pyx_XDECREF(__pyx_r);
6856  __Pyx_INCREF(__pyx_empty_tuple);
6857  __pyx_r = __pyx_empty_tuple;
6858  goto __pyx_L0;
6859  }
6860 
6861  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6862  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6863  *
6864  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6865  * if PyDataType_HASSUBARRAY(d):
6866  * return <tuple>d.subarray.shape
6867  */
6868 
6869  /* function exit code */
6870  __pyx_L1_error:;
6871  __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
6872  __pyx_r = 0;
6873  __pyx_L0:;
6874  __Pyx_XGIVEREF(__pyx_r);
6875  __Pyx_TraceReturn(__pyx_r, 0);
6876  __Pyx_RefNannyFinishContext();
6877  return __pyx_r;
6878 }
6879 
6880 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
6881  * return ()
6882  *
6883  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6884  * # Recursive utility function used in __getbuffer__ to get format
6885  * # string. The new location in the format string is returned.
6886  */
6887 
6888 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
6889  PyArray_Descr *__pyx_v_child = 0;
6890  int __pyx_v_endian_detector;
6891  int __pyx_v_little_endian;
6892  PyObject *__pyx_v_fields = 0;
6893  PyObject *__pyx_v_childname = NULL;
6894  PyObject *__pyx_v_new_offset = NULL;
6895  PyObject *__pyx_v_t = NULL;
6896  char *__pyx_r;
6897  __Pyx_TraceDeclarations
6898  __Pyx_RefNannyDeclarations
6899  PyObject *__pyx_t_1 = NULL;
6900  Py_ssize_t __pyx_t_2;
6901  PyObject *__pyx_t_3 = NULL;
6902  PyObject *__pyx_t_4 = NULL;
6903  int __pyx_t_5;
6904  int __pyx_t_6;
6905  int __pyx_t_7;
6906  long __pyx_t_8;
6907  char *__pyx_t_9;
6908  int __pyx_lineno = 0;
6909  const char *__pyx_filename = NULL;
6910  int __pyx_clineno = 0;
6911  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6912  __Pyx_TraceCall("_util_dtypestring", __pyx_f[3], 763, 0, __PYX_ERR(3, 763, __pyx_L1_error));
6913 
6914  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":768
6915  *
6916  * cdef dtype child
6917  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6918  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6919  * cdef tuple fields
6920  */
6921  __pyx_v_endian_detector = 1;
6922 
6923  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":769
6924  * cdef dtype child
6925  * cdef int endian_detector = 1
6926  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6927  * cdef tuple fields
6928  *
6929  */
6930  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6931 
6932  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
6933  * cdef tuple fields
6934  *
6935  * for childname in descr.names: # <<<<<<<<<<<<<<
6936  * fields = descr.fields[childname]
6937  * child, new_offset = fields
6938  */
6939  if (unlikely(__pyx_v_descr->names == Py_None)) {
6940  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6941  __PYX_ERR(3, 772, __pyx_L1_error)
6942  }
6943  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6944  for (;;) {
6945  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6946  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6947  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 772, __pyx_L1_error)
6948  #else
6949  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 772, __pyx_L1_error)
6950  __Pyx_GOTREF(__pyx_t_3);
6951  #endif
6952  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6953  __pyx_t_3 = 0;
6954 
6955  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":773
6956  *
6957  * for childname in descr.names:
6958  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6959  * child, new_offset = fields
6960  *
6961  */
6962  if (unlikely(__pyx_v_descr->fields == Py_None)) {
6963  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6964  __PYX_ERR(3, 773, __pyx_L1_error)
6965  }
6966  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 773, __pyx_L1_error)
6967  __Pyx_GOTREF(__pyx_t_3);
6968  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 773, __pyx_L1_error)
6969  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6970  __pyx_t_3 = 0;
6971 
6972  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":774
6973  * for childname in descr.names:
6974  * fields = descr.fields[childname]
6975  * child, new_offset = fields # <<<<<<<<<<<<<<
6976  *
6977  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6978  */
6979  if (likely(__pyx_v_fields != Py_None)) {
6980  PyObject* sequence = __pyx_v_fields;
6981  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6982  if (unlikely(size != 2)) {
6983  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6984  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6985  __PYX_ERR(3, 774, __pyx_L1_error)
6986  }
6987  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6988  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6989  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6990  __Pyx_INCREF(__pyx_t_3);
6991  __Pyx_INCREF(__pyx_t_4);
6992  #else
6993  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 774, __pyx_L1_error)
6994  __Pyx_GOTREF(__pyx_t_3);
6995  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 774, __pyx_L1_error)
6996  __Pyx_GOTREF(__pyx_t_4);
6997  #endif
6998  } else {
6999  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 774, __pyx_L1_error)
7000  }
7001  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 774, __pyx_L1_error)
7002  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7003  __pyx_t_3 = 0;
7004  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7005  __pyx_t_4 = 0;
7006 
7007  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7008  * child, new_offset = fields
7009  *
7010  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7011  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7012  *
7013  */
7014  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 776, __pyx_L1_error)
7015  __Pyx_GOTREF(__pyx_t_4);
7016  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 776, __pyx_L1_error)
7017  __Pyx_GOTREF(__pyx_t_3);
7018  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7019  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 776, __pyx_L1_error)
7020  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7021  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7022  if (unlikely(__pyx_t_6)) {
7023 
7024  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
7025  *
7026  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7027  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7028  *
7029  * if ((child.byteorder == c'>' and little_endian) or
7030  */
7031  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 777, __pyx_L1_error)
7032  __Pyx_GOTREF(__pyx_t_3);
7033  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7034  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7035  __PYX_ERR(3, 777, __pyx_L1_error)
7036 
7037  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7038  * child, new_offset = fields
7039  *
7040  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7041  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7042  *
7043  */
7044  }
7045 
7046  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7047  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7048  *
7049  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7050  * (child.byteorder == c'<' and not little_endian)):
7051  * raise ValueError(u"Non-native byte order not supported")
7052  */
7053  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7054  if (!__pyx_t_7) {
7055  goto __pyx_L8_next_or;
7056  } else {
7057  }
7058  __pyx_t_7 = (__pyx_v_little_endian != 0);
7059  if (!__pyx_t_7) {
7060  } else {
7061  __pyx_t_6 = __pyx_t_7;
7062  goto __pyx_L7_bool_binop_done;
7063  }
7064  __pyx_L8_next_or:;
7065 
7066  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":780
7067  *
7068  * if ((child.byteorder == c'>' and little_endian) or
7069  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7070  * raise ValueError(u"Non-native byte order not supported")
7071  * # One could encode it in the format string and have Cython
7072  */
7073  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7074  if (__pyx_t_7) {
7075  } else {
7076  __pyx_t_6 = __pyx_t_7;
7077  goto __pyx_L7_bool_binop_done;
7078  }
7079  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7080  __pyx_t_6 = __pyx_t_7;
7081  __pyx_L7_bool_binop_done:;
7082 
7083  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7084  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7085  *
7086  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7087  * (child.byteorder == c'<' and not little_endian)):
7088  * raise ValueError(u"Non-native byte order not supported")
7089  */
7090  if (unlikely(__pyx_t_6)) {
7091 
7092  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
7093  * if ((child.byteorder == c'>' and little_endian) or
7094  * (child.byteorder == c'<' and not little_endian)):
7095  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7096  * # One could encode it in the format string and have Cython
7097  * # complain instead, BUT: < and > in format strings also imply
7098  */
7099  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 781, __pyx_L1_error)
7100  __Pyx_GOTREF(__pyx_t_3);
7101  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7102  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7103  __PYX_ERR(3, 781, __pyx_L1_error)
7104 
7105  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7106  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7107  *
7108  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7109  * (child.byteorder == c'<' and not little_endian)):
7110  * raise ValueError(u"Non-native byte order not supported")
7111  */
7112  }
7113 
7114  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":791
7115  *
7116  * # Output padding bytes
7117  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7118  * f[0] = 120 # "x"; pad byte
7119  * f += 1
7120  */
7121  while (1) {
7122  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 791, __pyx_L1_error)
7123  __Pyx_GOTREF(__pyx_t_3);
7124  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 791, __pyx_L1_error)
7125  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7126  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 791, __pyx_L1_error)
7127  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7128  if (!__pyx_t_6) break;
7129 
7130  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":792
7131  * # Output padding bytes
7132  * while offset[0] < new_offset:
7133  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7134  * f += 1
7135  * offset[0] += 1
7136  */
7137  (__pyx_v_f[0]) = 0x78;
7138 
7139  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":793
7140  * while offset[0] < new_offset:
7141  * f[0] = 120 # "x"; pad byte
7142  * f += 1 # <<<<<<<<<<<<<<
7143  * offset[0] += 1
7144  *
7145  */
7146  __pyx_v_f = (__pyx_v_f + 1);
7147 
7148  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":794
7149  * f[0] = 120 # "x"; pad byte
7150  * f += 1
7151  * offset[0] += 1 # <<<<<<<<<<<<<<
7152  *
7153  * offset[0] += child.itemsize
7154  */
7155  __pyx_t_8 = 0;
7156  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7157  }
7158 
7159  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":796
7160  * offset[0] += 1
7161  *
7162  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7163  *
7164  * if not PyDataType_HASFIELDS(child):
7165  */
7166  __pyx_t_8 = 0;
7167  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7168 
7169  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7170  * offset[0] += child.itemsize
7171  *
7172  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7173  * t = child.type_num
7174  * if end - f < 5:
7175  */
7176  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7177  if (__pyx_t_6) {
7178 
7179  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":799
7180  *
7181  * if not PyDataType_HASFIELDS(child):
7182  * t = child.type_num # <<<<<<<<<<<<<<
7183  * if end - f < 5:
7184  * raise RuntimeError(u"Format string allocated too short.")
7185  */
7186  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 799, __pyx_L1_error)
7187  __Pyx_GOTREF(__pyx_t_4);
7188  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7189  __pyx_t_4 = 0;
7190 
7191  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7192  * if not PyDataType_HASFIELDS(child):
7193  * t = child.type_num
7194  * if end - f < 5: # <<<<<<<<<<<<<<
7195  * raise RuntimeError(u"Format string allocated too short.")
7196  *
7197  */
7198  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7199  if (unlikely(__pyx_t_6)) {
7200 
7201  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
7202  * t = child.type_num
7203  * if end - f < 5:
7204  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7205  *
7206  * # Until ticket #99 is fixed, use integers to avoid warnings
7207  */
7208  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 801, __pyx_L1_error)
7209  __Pyx_GOTREF(__pyx_t_4);
7210  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7211  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7212  __PYX_ERR(3, 801, __pyx_L1_error)
7213 
7214  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7215  * if not PyDataType_HASFIELDS(child):
7216  * t = child.type_num
7217  * if end - f < 5: # <<<<<<<<<<<<<<
7218  * raise RuntimeError(u"Format string allocated too short.")
7219  *
7220  */
7221  }
7222 
7223  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":804
7224  *
7225  * # Until ticket #99 is fixed, use integers to avoid warnings
7226  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7227  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7228  * elif t == NPY_SHORT: f[0] = 104 #"h"
7229  */
7230  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 804, __pyx_L1_error)
7231  __Pyx_GOTREF(__pyx_t_4);
7232  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 804, __pyx_L1_error)
7233  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7234  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 804, __pyx_L1_error)
7235  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7236  if (__pyx_t_6) {
7237  (__pyx_v_f[0]) = 98;
7238  goto __pyx_L15;
7239  }
7240 
7241  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":805
7242  * # Until ticket #99 is fixed, use integers to avoid warnings
7243  * if t == NPY_BYTE: f[0] = 98 #"b"
7244  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7245  * elif t == NPY_SHORT: f[0] = 104 #"h"
7246  * elif t == NPY_USHORT: f[0] = 72 #"H"
7247  */
7248  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
7249  __Pyx_GOTREF(__pyx_t_3);
7250  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 805, __pyx_L1_error)
7251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7252  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
7253  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7254  if (__pyx_t_6) {
7255  (__pyx_v_f[0]) = 66;
7256  goto __pyx_L15;
7257  }
7258 
7259  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":806
7260  * if t == NPY_BYTE: f[0] = 98 #"b"
7261  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7262  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7263  * elif t == NPY_USHORT: f[0] = 72 #"H"
7264  * elif t == NPY_INT: f[0] = 105 #"i"
7265  */
7266  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 806, __pyx_L1_error)
7267  __Pyx_GOTREF(__pyx_t_4);
7268  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
7269  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7270  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 806, __pyx_L1_error)
7271  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7272  if (__pyx_t_6) {
7273  (__pyx_v_f[0]) = 0x68;
7274  goto __pyx_L15;
7275  }
7276 
7277  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":807
7278  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7279  * elif t == NPY_SHORT: f[0] = 104 #"h"
7280  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7281  * elif t == NPY_INT: f[0] = 105 #"i"
7282  * elif t == NPY_UINT: f[0] = 73 #"I"
7283  */
7284  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
7285  __Pyx_GOTREF(__pyx_t_3);
7286  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
7287  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7288  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 807, __pyx_L1_error)
7289  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7290  if (__pyx_t_6) {
7291  (__pyx_v_f[0]) = 72;
7292  goto __pyx_L15;
7293  }
7294 
7295  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":808
7296  * elif t == NPY_SHORT: f[0] = 104 #"h"
7297  * elif t == NPY_USHORT: f[0] = 72 #"H"
7298  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7299  * elif t == NPY_UINT: f[0] = 73 #"I"
7300  * elif t == NPY_LONG: f[0] = 108 #"l"
7301  */
7302  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 808, __pyx_L1_error)
7303  __Pyx_GOTREF(__pyx_t_4);
7304  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 808, __pyx_L1_error)
7305  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7306  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 808, __pyx_L1_error)
7307  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7308  if (__pyx_t_6) {
7309  (__pyx_v_f[0]) = 0x69;
7310  goto __pyx_L15;
7311  }
7312 
7313  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":809
7314  * elif t == NPY_USHORT: f[0] = 72 #"H"
7315  * elif t == NPY_INT: f[0] = 105 #"i"
7316  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7317  * elif t == NPY_LONG: f[0] = 108 #"l"
7318  * elif t == NPY_ULONG: f[0] = 76 #"L"
7319  */
7320  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
7321  __Pyx_GOTREF(__pyx_t_3);
7322  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
7323  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7324  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 809, __pyx_L1_error)
7325  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7326  if (__pyx_t_6) {
7327  (__pyx_v_f[0]) = 73;
7328  goto __pyx_L15;
7329  }
7330 
7331  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":810
7332  * elif t == NPY_INT: f[0] = 105 #"i"
7333  * elif t == NPY_UINT: f[0] = 73 #"I"
7334  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7335  * elif t == NPY_ULONG: f[0] = 76 #"L"
7336  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7337  */
7338  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 810, __pyx_L1_error)
7339  __Pyx_GOTREF(__pyx_t_4);
7340  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
7341  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7342  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 810, __pyx_L1_error)
7343  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7344  if (__pyx_t_6) {
7345  (__pyx_v_f[0]) = 0x6C;
7346  goto __pyx_L15;
7347  }
7348 
7349  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":811
7350  * elif t == NPY_UINT: f[0] = 73 #"I"
7351  * elif t == NPY_LONG: f[0] = 108 #"l"
7352  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7353  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7354  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7355  */
7356  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 811, __pyx_L1_error)
7357  __Pyx_GOTREF(__pyx_t_3);
7358  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 811, __pyx_L1_error)
7359  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7360  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 811, __pyx_L1_error)
7361  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7362  if (__pyx_t_6) {
7363  (__pyx_v_f[0]) = 76;
7364  goto __pyx_L15;
7365  }
7366 
7367  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":812
7368  * elif t == NPY_LONG: f[0] = 108 #"l"
7369  * elif t == NPY_ULONG: f[0] = 76 #"L"
7370  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7371  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7372  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7373  */
7374  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 812, __pyx_L1_error)
7375  __Pyx_GOTREF(__pyx_t_4);
7376  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 812, __pyx_L1_error)
7377  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7378  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 812, __pyx_L1_error)
7379  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7380  if (__pyx_t_6) {
7381  (__pyx_v_f[0]) = 0x71;
7382  goto __pyx_L15;
7383  }
7384 
7385  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":813
7386  * elif t == NPY_ULONG: f[0] = 76 #"L"
7387  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7388  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7389  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7390  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7391  */
7392  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error)
7393  __Pyx_GOTREF(__pyx_t_3);
7394  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error)
7395  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7396  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error)
7397  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7398  if (__pyx_t_6) {
7399  (__pyx_v_f[0]) = 81;
7400  goto __pyx_L15;
7401  }
7402 
7403  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":814
7404  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7405  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7406  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7407  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7408  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7409  */
7410  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 814, __pyx_L1_error)
7411  __Pyx_GOTREF(__pyx_t_4);
7412  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
7413  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7414  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 814, __pyx_L1_error)
7415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7416  if (__pyx_t_6) {
7417  (__pyx_v_f[0]) = 0x66;
7418  goto __pyx_L15;
7419  }
7420 
7421  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":815
7422  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7423  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7424  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7425  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7426  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7427  */
7428  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 815, __pyx_L1_error)
7429  __Pyx_GOTREF(__pyx_t_3);
7430  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 815, __pyx_L1_error)
7431  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7432  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 815, __pyx_L1_error)
7433  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7434  if (__pyx_t_6) {
7435  (__pyx_v_f[0]) = 0x64;
7436  goto __pyx_L15;
7437  }
7438 
7439  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":816
7440  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7441  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7442  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7443  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7444  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7445  */
7446  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 816, __pyx_L1_error)
7447  __Pyx_GOTREF(__pyx_t_4);
7448  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 816, __pyx_L1_error)
7449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7450  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 816, __pyx_L1_error)
7451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7452  if (__pyx_t_6) {
7453  (__pyx_v_f[0]) = 0x67;
7454  goto __pyx_L15;
7455  }
7456 
7457  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":817
7458  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7459  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7460  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7461  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7462  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7463  */
7464  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 817, __pyx_L1_error)
7465  __Pyx_GOTREF(__pyx_t_3);
7466  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 817, __pyx_L1_error)
7467  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7468  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 817, __pyx_L1_error)
7469  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7470  if (__pyx_t_6) {
7471  (__pyx_v_f[0]) = 90;
7472  (__pyx_v_f[1]) = 0x66;
7473  __pyx_v_f = (__pyx_v_f + 1);
7474  goto __pyx_L15;
7475  }
7476 
7477  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":818
7478  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7479  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7480  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7481  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7482  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7483  */
7484  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 818, __pyx_L1_error)
7485  __Pyx_GOTREF(__pyx_t_4);
7486  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 818, __pyx_L1_error)
7487  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7488  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 818, __pyx_L1_error)
7489  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7490  if (__pyx_t_6) {
7491  (__pyx_v_f[0]) = 90;
7492  (__pyx_v_f[1]) = 0x64;
7493  __pyx_v_f = (__pyx_v_f + 1);
7494  goto __pyx_L15;
7495  }
7496 
7497  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":819
7498  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7499  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7500  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7501  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7502  * else:
7503  */
7504  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 819, __pyx_L1_error)
7505  __Pyx_GOTREF(__pyx_t_3);
7506  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 819, __pyx_L1_error)
7507  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7508  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 819, __pyx_L1_error)
7509  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7510  if (__pyx_t_6) {
7511  (__pyx_v_f[0]) = 90;
7512  (__pyx_v_f[1]) = 0x67;
7513  __pyx_v_f = (__pyx_v_f + 1);
7514  goto __pyx_L15;
7515  }
7516 
7517  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":820
7518  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7519  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7520  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7521  * else:
7522  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7523  */
7524  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 820, __pyx_L1_error)
7525  __Pyx_GOTREF(__pyx_t_4);
7526  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 820, __pyx_L1_error)
7527  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7528  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 820, __pyx_L1_error)
7529  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7530  if (likely(__pyx_t_6)) {
7531  (__pyx_v_f[0]) = 79;
7532  goto __pyx_L15;
7533  }
7534 
7535  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":822
7536  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7537  * else:
7538  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7539  * f += 1
7540  * else:
7541  */
7542  /*else*/ {
7543  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 822, __pyx_L1_error)
7544  __Pyx_GOTREF(__pyx_t_3);
7545  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 822, __pyx_L1_error)
7546  __Pyx_GOTREF(__pyx_t_4);
7547  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7548  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7549  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7550  __PYX_ERR(3, 822, __pyx_L1_error)
7551  }
7552  __pyx_L15:;
7553 
7554  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":823
7555  * else:
7556  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7557  * f += 1 # <<<<<<<<<<<<<<
7558  * else:
7559  * # Cython ignores struct boundary information ("T{...}"),
7560  */
7561  __pyx_v_f = (__pyx_v_f + 1);
7562 
7563  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7564  * offset[0] += child.itemsize
7565  *
7566  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7567  * t = child.type_num
7568  * if end - f < 5:
7569  */
7570  goto __pyx_L13;
7571  }
7572 
7573  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":827
7574  * # Cython ignores struct boundary information ("T{...}"),
7575  * # so don't output it
7576  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7577  * return f
7578  *
7579  */
7580  /*else*/ {
7581  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 827, __pyx_L1_error)
7582  __pyx_v_f = __pyx_t_9;
7583  }
7584  __pyx_L13:;
7585 
7586  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
7587  * cdef tuple fields
7588  *
7589  * for childname in descr.names: # <<<<<<<<<<<<<<
7590  * fields = descr.fields[childname]
7591  * child, new_offset = fields
7592  */
7593  }
7594  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7595 
7596  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":828
7597  * # so don't output it
7598  * f = _util_dtypestring(child, f, end, offset)
7599  * return f # <<<<<<<<<<<<<<
7600  *
7601  *
7602  */
7603  __pyx_r = __pyx_v_f;
7604  goto __pyx_L0;
7605 
7606  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
7607  * return ()
7608  *
7609  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7610  * # Recursive utility function used in __getbuffer__ to get format
7611  * # string. The new location in the format string is returned.
7612  */
7613 
7614  /* function exit code */
7615  __pyx_L1_error:;
7616  __Pyx_XDECREF(__pyx_t_1);
7617  __Pyx_XDECREF(__pyx_t_3);
7618  __Pyx_XDECREF(__pyx_t_4);
7619  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7620  __pyx_r = NULL;
7621  __pyx_L0:;
7622  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7623  __Pyx_XDECREF(__pyx_v_fields);
7624  __Pyx_XDECREF(__pyx_v_childname);
7625  __Pyx_XDECREF(__pyx_v_new_offset);
7626  __Pyx_XDECREF(__pyx_v_t);
7627  __Pyx_TraceReturn(Py_None, 0);
7628  __Pyx_RefNannyFinishContext();
7629  return __pyx_r;
7630 }
7631 
7632 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7633  * int _import_umath() except -1
7634  *
7635  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7636  * Py_INCREF(base) # important to do this before stealing the reference below!
7637  * PyArray_SetBaseObject(arr, base)
7638  */
7639 
7640 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7641  __Pyx_TraceDeclarations
7642  __Pyx_RefNannyDeclarations
7643  int __pyx_lineno = 0;
7644  const char *__pyx_filename = NULL;
7645  int __pyx_clineno = 0;
7646  __Pyx_RefNannySetupContext("set_array_base", 0);
7647  __Pyx_TraceCall("set_array_base", __pyx_f[3], 943, 0, __PYX_ERR(3, 943, __pyx_L1_error));
7648 
7649  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":944
7650  *
7651  * cdef inline void set_array_base(ndarray arr, object base):
7652  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7653  * PyArray_SetBaseObject(arr, base)
7654  *
7655  */
7656  Py_INCREF(__pyx_v_base);
7657 
7658  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":945
7659  * cdef inline void set_array_base(ndarray arr, object base):
7660  * Py_INCREF(base) # important to do this before stealing the reference below!
7661  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7662  *
7663  * cdef inline object get_array_base(ndarray arr):
7664  */
7665  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7666 
7667  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7668  * int _import_umath() except -1
7669  *
7670  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7671  * Py_INCREF(base) # important to do this before stealing the reference below!
7672  * PyArray_SetBaseObject(arr, base)
7673  */
7674 
7675  /* function exit code */
7676  goto __pyx_L0;
7677  __pyx_L1_error:;
7678  __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7679  __pyx_L0:;
7680  __Pyx_TraceReturn(Py_None, 0);
7681  __Pyx_RefNannyFinishContext();
7682 }
7683 
7684 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7685  * PyArray_SetBaseObject(arr, base)
7686  *
7687  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7688  * base = PyArray_BASE(arr)
7689  * if base is NULL:
7690  */
7691 
7692 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7693  PyObject *__pyx_v_base;
7694  PyObject *__pyx_r = NULL;
7695  __Pyx_TraceDeclarations
7696  __Pyx_RefNannyDeclarations
7697  int __pyx_t_1;
7698  int __pyx_lineno = 0;
7699  const char *__pyx_filename = NULL;
7700  int __pyx_clineno = 0;
7701  __Pyx_RefNannySetupContext("get_array_base", 0);
7702  __Pyx_TraceCall("get_array_base", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7703 
7704  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":948
7705  *
7706  * cdef inline object get_array_base(ndarray arr):
7707  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7708  * if base is NULL:
7709  * return None
7710  */
7711  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7712 
7713  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7714  * cdef inline object get_array_base(ndarray arr):
7715  * base = PyArray_BASE(arr)
7716  * if base is NULL: # <<<<<<<<<<<<<<
7717  * return None
7718  * return <object>base
7719  */
7720  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7721  if (__pyx_t_1) {
7722 
7723  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":950
7724  * base = PyArray_BASE(arr)
7725  * if base is NULL:
7726  * return None # <<<<<<<<<<<<<<
7727  * return <object>base
7728  *
7729  */
7730  __Pyx_XDECREF(__pyx_r);
7731  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7732  goto __pyx_L0;
7733 
7734  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7735  * cdef inline object get_array_base(ndarray arr):
7736  * base = PyArray_BASE(arr)
7737  * if base is NULL: # <<<<<<<<<<<<<<
7738  * return None
7739  * return <object>base
7740  */
7741  }
7742 
7743  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":951
7744  * if base is NULL:
7745  * return None
7746  * return <object>base # <<<<<<<<<<<<<<
7747  *
7748  * # Versions of the import_* functions which are more suitable for
7749  */
7750  __Pyx_XDECREF(__pyx_r);
7751  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7752  __pyx_r = ((PyObject *)__pyx_v_base);
7753  goto __pyx_L0;
7754 
7755  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7756  * PyArray_SetBaseObject(arr, base)
7757  *
7758  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7759  * base = PyArray_BASE(arr)
7760  * if base is NULL:
7761  */
7762 
7763  /* function exit code */
7764  __pyx_L1_error:;
7765  __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7766  __pyx_r = 0;
7767  __pyx_L0:;
7768  __Pyx_XGIVEREF(__pyx_r);
7769  __Pyx_TraceReturn(__pyx_r, 0);
7770  __Pyx_RefNannyFinishContext();
7771  return __pyx_r;
7772 }
7773 
7774 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7775  * # Versions of the import_* functions which are more suitable for
7776  * # Cython code.
7777  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7778  * try:
7779  * __pyx_import_array()
7780  */
7781 
7782 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7783  int __pyx_r;
7784  __Pyx_TraceDeclarations
7785  __Pyx_RefNannyDeclarations
7786  PyObject *__pyx_t_1 = NULL;
7787  PyObject *__pyx_t_2 = NULL;
7788  PyObject *__pyx_t_3 = NULL;
7789  int __pyx_t_4;
7790  PyObject *__pyx_t_5 = NULL;
7791  PyObject *__pyx_t_6 = NULL;
7792  PyObject *__pyx_t_7 = NULL;
7793  PyObject *__pyx_t_8 = NULL;
7794  int __pyx_lineno = 0;
7795  const char *__pyx_filename = NULL;
7796  int __pyx_clineno = 0;
7797  __Pyx_RefNannySetupContext("import_array", 0);
7798  __Pyx_TraceCall("import_array", __pyx_f[3], 955, 0, __PYX_ERR(3, 955, __pyx_L1_error));
7799 
7800  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7801  * # Cython code.
7802  * cdef inline int import_array() except -1:
7803  * try: # <<<<<<<<<<<<<<
7804  * __pyx_import_array()
7805  * except Exception:
7806  */
7807  {
7808  __Pyx_PyThreadState_declare
7809  __Pyx_PyThreadState_assign
7810  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7811  __Pyx_XGOTREF(__pyx_t_1);
7812  __Pyx_XGOTREF(__pyx_t_2);
7813  __Pyx_XGOTREF(__pyx_t_3);
7814  /*try:*/ {
7815 
7816  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":957
7817  * cdef inline int import_array() except -1:
7818  * try:
7819  * __pyx_import_array() # <<<<<<<<<<<<<<
7820  * except Exception:
7821  * raise ImportError("numpy.core.multiarray failed to import")
7822  */
7823  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 957, __pyx_L3_error)
7824 
7825  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7826  * # Cython code.
7827  * cdef inline int import_array() except -1:
7828  * try: # <<<<<<<<<<<<<<
7829  * __pyx_import_array()
7830  * except Exception:
7831  */
7832  }
7833  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7834  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7835  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7836  goto __pyx_L8_try_end;
7837  __pyx_L3_error:;
7838 
7839  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":958
7840  * try:
7841  * __pyx_import_array()
7842  * except Exception: # <<<<<<<<<<<<<<
7843  * raise ImportError("numpy.core.multiarray failed to import")
7844  *
7845  */
7846  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7847  if (__pyx_t_4) {
7848  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7849  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 958, __pyx_L5_except_error)
7850  __Pyx_GOTREF(__pyx_t_5);
7851  __Pyx_GOTREF(__pyx_t_6);
7852  __Pyx_GOTREF(__pyx_t_7);
7853 
7854  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
7855  * __pyx_import_array()
7856  * except Exception:
7857  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7858  *
7859  * cdef inline int import_umath() except -1:
7860  */
7861  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 959, __pyx_L5_except_error)
7862  __Pyx_GOTREF(__pyx_t_8);
7863  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7864  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7865  __PYX_ERR(3, 959, __pyx_L5_except_error)
7866  }
7867  goto __pyx_L5_except_error;
7868  __pyx_L5_except_error:;
7869 
7870  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7871  * # Cython code.
7872  * cdef inline int import_array() except -1:
7873  * try: # <<<<<<<<<<<<<<
7874  * __pyx_import_array()
7875  * except Exception:
7876  */
7877  __Pyx_XGIVEREF(__pyx_t_1);
7878  __Pyx_XGIVEREF(__pyx_t_2);
7879  __Pyx_XGIVEREF(__pyx_t_3);
7880  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7881  goto __pyx_L1_error;
7882  __pyx_L8_try_end:;
7883  }
7884 
7885  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7886  * # Versions of the import_* functions which are more suitable for
7887  * # Cython code.
7888  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7889  * try:
7890  * __pyx_import_array()
7891  */
7892 
7893  /* function exit code */
7894  __pyx_r = 0;
7895  goto __pyx_L0;
7896  __pyx_L1_error:;
7897  __Pyx_XDECREF(__pyx_t_5);
7898  __Pyx_XDECREF(__pyx_t_6);
7899  __Pyx_XDECREF(__pyx_t_7);
7900  __Pyx_XDECREF(__pyx_t_8);
7901  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7902  __pyx_r = -1;
7903  __pyx_L0:;
7904  __Pyx_TraceReturn(Py_None, 0);
7905  __Pyx_RefNannyFinishContext();
7906  return __pyx_r;
7907 }
7908 
7909 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
7910  * raise ImportError("numpy.core.multiarray failed to import")
7911  *
7912  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7913  * try:
7914  * _import_umath()
7915  */
7916 
7917 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7918  int __pyx_r;
7919  __Pyx_TraceDeclarations
7920  __Pyx_RefNannyDeclarations
7921  PyObject *__pyx_t_1 = NULL;
7922  PyObject *__pyx_t_2 = NULL;
7923  PyObject *__pyx_t_3 = NULL;
7924  int __pyx_t_4;
7925  PyObject *__pyx_t_5 = NULL;
7926  PyObject *__pyx_t_6 = NULL;
7927  PyObject *__pyx_t_7 = NULL;
7928  PyObject *__pyx_t_8 = NULL;
7929  int __pyx_lineno = 0;
7930  const char *__pyx_filename = NULL;
7931  int __pyx_clineno = 0;
7932  __Pyx_RefNannySetupContext("import_umath", 0);
7933  __Pyx_TraceCall("import_umath", __pyx_f[3], 961, 0, __PYX_ERR(3, 961, __pyx_L1_error));
7934 
7935  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7936  *
7937  * cdef inline int import_umath() except -1:
7938  * try: # <<<<<<<<<<<<<<
7939  * _import_umath()
7940  * except Exception:
7941  */
7942  {
7943  __Pyx_PyThreadState_declare
7944  __Pyx_PyThreadState_assign
7945  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7946  __Pyx_XGOTREF(__pyx_t_1);
7947  __Pyx_XGOTREF(__pyx_t_2);
7948  __Pyx_XGOTREF(__pyx_t_3);
7949  /*try:*/ {
7950 
7951  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":963
7952  * cdef inline int import_umath() except -1:
7953  * try:
7954  * _import_umath() # <<<<<<<<<<<<<<
7955  * except Exception:
7956  * raise ImportError("numpy.core.umath failed to import")
7957  */
7958  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 963, __pyx_L3_error)
7959 
7960  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7961  *
7962  * cdef inline int import_umath() except -1:
7963  * try: # <<<<<<<<<<<<<<
7964  * _import_umath()
7965  * except Exception:
7966  */
7967  }
7968  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7969  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7970  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7971  goto __pyx_L8_try_end;
7972  __pyx_L3_error:;
7973 
7974  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":964
7975  * try:
7976  * _import_umath()
7977  * except Exception: # <<<<<<<<<<<<<<
7978  * raise ImportError("numpy.core.umath failed to import")
7979  *
7980  */
7981  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7982  if (__pyx_t_4) {
7983  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7984  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 964, __pyx_L5_except_error)
7985  __Pyx_GOTREF(__pyx_t_5);
7986  __Pyx_GOTREF(__pyx_t_6);
7987  __Pyx_GOTREF(__pyx_t_7);
7988 
7989  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
7990  * _import_umath()
7991  * except Exception:
7992  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7993  *
7994  * cdef inline int import_ufunc() except -1:
7995  */
7996  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 965, __pyx_L5_except_error)
7997  __Pyx_GOTREF(__pyx_t_8);
7998  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7999  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8000  __PYX_ERR(3, 965, __pyx_L5_except_error)
8001  }
8002  goto __pyx_L5_except_error;
8003  __pyx_L5_except_error:;
8004 
8005  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
8006  *
8007  * cdef inline int import_umath() except -1:
8008  * try: # <<<<<<<<<<<<<<
8009  * _import_umath()
8010  * except Exception:
8011  */
8012  __Pyx_XGIVEREF(__pyx_t_1);
8013  __Pyx_XGIVEREF(__pyx_t_2);
8014  __Pyx_XGIVEREF(__pyx_t_3);
8015  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8016  goto __pyx_L1_error;
8017  __pyx_L8_try_end:;
8018  }
8019 
8020  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
8021  * raise ImportError("numpy.core.multiarray failed to import")
8022  *
8023  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8024  * try:
8025  * _import_umath()
8026  */
8027 
8028  /* function exit code */
8029  __pyx_r = 0;
8030  goto __pyx_L0;
8031  __pyx_L1_error:;
8032  __Pyx_XDECREF(__pyx_t_5);
8033  __Pyx_XDECREF(__pyx_t_6);
8034  __Pyx_XDECREF(__pyx_t_7);
8035  __Pyx_XDECREF(__pyx_t_8);
8036  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8037  __pyx_r = -1;
8038  __pyx_L0:;
8039  __Pyx_TraceReturn(Py_None, 0);
8040  __Pyx_RefNannyFinishContext();
8041  return __pyx_r;
8042 }
8043 
8044 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8045  * raise ImportError("numpy.core.umath failed to import")
8046  *
8047  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8048  * try:
8049  * _import_umath()
8050  */
8051 
8052 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8053  int __pyx_r;
8054  __Pyx_TraceDeclarations
8055  __Pyx_RefNannyDeclarations
8056  PyObject *__pyx_t_1 = NULL;
8057  PyObject *__pyx_t_2 = NULL;
8058  PyObject *__pyx_t_3 = NULL;
8059  int __pyx_t_4;
8060  PyObject *__pyx_t_5 = NULL;
8061  PyObject *__pyx_t_6 = NULL;
8062  PyObject *__pyx_t_7 = NULL;
8063  PyObject *__pyx_t_8 = NULL;
8064  int __pyx_lineno = 0;
8065  const char *__pyx_filename = NULL;
8066  int __pyx_clineno = 0;
8067  __Pyx_RefNannySetupContext("import_ufunc", 0);
8068  __Pyx_TraceCall("import_ufunc", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
8069 
8070  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8071  *
8072  * cdef inline int import_ufunc() except -1:
8073  * try: # <<<<<<<<<<<<<<
8074  * _import_umath()
8075  * except Exception:
8076  */
8077  {
8078  __Pyx_PyThreadState_declare
8079  __Pyx_PyThreadState_assign
8080  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8081  __Pyx_XGOTREF(__pyx_t_1);
8082  __Pyx_XGOTREF(__pyx_t_2);
8083  __Pyx_XGOTREF(__pyx_t_3);
8084  /*try:*/ {
8085 
8086  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":969
8087  * cdef inline int import_ufunc() except -1:
8088  * try:
8089  * _import_umath() # <<<<<<<<<<<<<<
8090  * except Exception:
8091  * raise ImportError("numpy.core.umath failed to import")
8092  */
8093  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 969, __pyx_L3_error)
8094 
8095  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8096  *
8097  * cdef inline int import_ufunc() except -1:
8098  * try: # <<<<<<<<<<<<<<
8099  * _import_umath()
8100  * except Exception:
8101  */
8102  }
8103  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8104  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8105  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8106  goto __pyx_L8_try_end;
8107  __pyx_L3_error:;
8108 
8109  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":970
8110  * try:
8111  * _import_umath()
8112  * except Exception: # <<<<<<<<<<<<<<
8113  * raise ImportError("numpy.core.umath failed to import")
8114  *
8115  */
8116  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8117  if (__pyx_t_4) {
8118  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8119  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 970, __pyx_L5_except_error)
8120  __Pyx_GOTREF(__pyx_t_5);
8121  __Pyx_GOTREF(__pyx_t_6);
8122  __Pyx_GOTREF(__pyx_t_7);
8123 
8124  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":971
8125  * _import_umath()
8126  * except Exception:
8127  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8128  *
8129  * cdef extern from *:
8130  */
8131  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 971, __pyx_L5_except_error)
8132  __Pyx_GOTREF(__pyx_t_8);
8133  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8134  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8135  __PYX_ERR(3, 971, __pyx_L5_except_error)
8136  }
8137  goto __pyx_L5_except_error;
8138  __pyx_L5_except_error:;
8139 
8140  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8141  *
8142  * cdef inline int import_ufunc() except -1:
8143  * try: # <<<<<<<<<<<<<<
8144  * _import_umath()
8145  * except Exception:
8146  */
8147  __Pyx_XGIVEREF(__pyx_t_1);
8148  __Pyx_XGIVEREF(__pyx_t_2);
8149  __Pyx_XGIVEREF(__pyx_t_3);
8150  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8151  goto __pyx_L1_error;
8152  __pyx_L8_try_end:;
8153  }
8154 
8155  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8156  * raise ImportError("numpy.core.umath failed to import")
8157  *
8158  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8159  * try:
8160  * _import_umath()
8161  */
8162 
8163  /* function exit code */
8164  __pyx_r = 0;
8165  goto __pyx_L0;
8166  __pyx_L1_error:;
8167  __Pyx_XDECREF(__pyx_t_5);
8168  __Pyx_XDECREF(__pyx_t_6);
8169  __Pyx_XDECREF(__pyx_t_7);
8170  __Pyx_XDECREF(__pyx_t_8);
8171  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8172  __pyx_r = -1;
8173  __pyx_L0:;
8174  __Pyx_TraceReturn(Py_None, 0);
8175  __Pyx_RefNannyFinishContext();
8176  return __pyx_r;
8177 }
8178 
8179 /* "View.MemoryView":122
8180  * cdef bint dtype_is_object
8181  *
8182  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8183  * mode="c", bint allocate_buffer=True):
8184  *
8185  */
8186 
8187 /* Python wrapper */
8188 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8189 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8190  PyObject *__pyx_v_shape = 0;
8191  Py_ssize_t __pyx_v_itemsize;
8192  PyObject *__pyx_v_format = 0;
8193  PyObject *__pyx_v_mode = 0;
8194  int __pyx_v_allocate_buffer;
8195  int __pyx_lineno = 0;
8196  const char *__pyx_filename = NULL;
8197  int __pyx_clineno = 0;
8198  int __pyx_r;
8199  __Pyx_RefNannyDeclarations
8200  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8201  {
8202  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8203  PyObject* values[5] = {0,0,0,0,0};
8204  values[3] = ((PyObject *)__pyx_n_s_c);
8205  if (unlikely(__pyx_kwds)) {
8206  Py_ssize_t kw_args;
8207  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8208  switch (pos_args) {
8209  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8210  CYTHON_FALLTHROUGH;
8211  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8212  CYTHON_FALLTHROUGH;
8213  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8214  CYTHON_FALLTHROUGH;
8215  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8216  CYTHON_FALLTHROUGH;
8217  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8218  CYTHON_FALLTHROUGH;
8219  case 0: break;
8220  default: goto __pyx_L5_argtuple_error;
8221  }
8222  kw_args = PyDict_Size(__pyx_kwds);
8223  switch (pos_args) {
8224  case 0:
8225  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8226  else goto __pyx_L5_argtuple_error;
8227  CYTHON_FALLTHROUGH;
8228  case 1:
8229  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8230  else {
8231  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8232  }
8233  CYTHON_FALLTHROUGH;
8234  case 2:
8235  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8236  else {
8237  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8238  }
8239  CYTHON_FALLTHROUGH;
8240  case 3:
8241  if (kw_args > 0) {
8242  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8243  if (value) { values[3] = value; kw_args--; }
8244  }
8245  CYTHON_FALLTHROUGH;
8246  case 4:
8247  if (kw_args > 0) {
8248  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8249  if (value) { values[4] = value; kw_args--; }
8250  }
8251  }
8252  if (unlikely(kw_args > 0)) {
8253  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8254  }
8255  } else {
8256  switch (PyTuple_GET_SIZE(__pyx_args)) {
8257  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8258  CYTHON_FALLTHROUGH;
8259  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8260  CYTHON_FALLTHROUGH;
8261  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8262  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8263  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8264  break;
8265  default: goto __pyx_L5_argtuple_error;
8266  }
8267  }
8268  __pyx_v_shape = ((PyObject*)values[0]);
8269  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8270  __pyx_v_format = values[2];
8271  __pyx_v_mode = values[3];
8272  if (values[4]) {
8273  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8274  } else {
8275 
8276  /* "View.MemoryView":123
8277  *
8278  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8279  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8280  *
8281  * cdef int idx
8282  */
8283  __pyx_v_allocate_buffer = ((int)1);
8284  }
8285  }
8286  goto __pyx_L4_argument_unpacking_done;
8287  __pyx_L5_argtuple_error:;
8288  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8289  __pyx_L3_error:;
8290  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8291  __Pyx_RefNannyFinishContext();
8292  return -1;
8293  __pyx_L4_argument_unpacking_done:;
8294  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8295  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8296  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8297  }
8298  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8299 
8300  /* "View.MemoryView":122
8301  * cdef bint dtype_is_object
8302  *
8303  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8304  * mode="c", bint allocate_buffer=True):
8305  *
8306  */
8307 
8308  /* function exit code */
8309  goto __pyx_L0;
8310  __pyx_L1_error:;
8311  __pyx_r = -1;
8312  __pyx_L0:;
8313  __Pyx_RefNannyFinishContext();
8314  return __pyx_r;
8315 }
8316 
8317 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8318  int __pyx_v_idx;
8319  Py_ssize_t __pyx_v_i;
8320  Py_ssize_t __pyx_v_dim;
8321  PyObject **__pyx_v_p;
8322  char __pyx_v_order;
8323  int __pyx_r;
8324  __Pyx_TraceDeclarations
8325  __Pyx_RefNannyDeclarations
8326  Py_ssize_t __pyx_t_1;
8327  int __pyx_t_2;
8328  PyObject *__pyx_t_3 = NULL;
8329  int __pyx_t_4;
8330  PyObject *__pyx_t_5 = NULL;
8331  PyObject *__pyx_t_6 = NULL;
8332  char *__pyx_t_7;
8333  int __pyx_t_8;
8334  Py_ssize_t __pyx_t_9;
8335  PyObject *__pyx_t_10 = NULL;
8336  Py_ssize_t __pyx_t_11;
8337  int __pyx_lineno = 0;
8338  const char *__pyx_filename = NULL;
8339  int __pyx_clineno = 0;
8340  __Pyx_RefNannySetupContext("__cinit__", 0);
8341  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
8342  __Pyx_INCREF(__pyx_v_format);
8343 
8344  /* "View.MemoryView":129
8345  * cdef PyObject **p
8346  *
8347  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8348  * self.itemsize = itemsize
8349  *
8350  */
8351  if (unlikely(__pyx_v_shape == Py_None)) {
8352  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8353  __PYX_ERR(1, 129, __pyx_L1_error)
8354  }
8355  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8356  __pyx_v_self->ndim = ((int)__pyx_t_1);
8357 
8358  /* "View.MemoryView":130
8359  *
8360  * self.ndim = <int> len(shape)
8361  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8362  *
8363  * if not self.ndim:
8364  */
8365  __pyx_v_self->itemsize = __pyx_v_itemsize;
8366 
8367  /* "View.MemoryView":132
8368  * self.itemsize = itemsize
8369  *
8370  * if not self.ndim: # <<<<<<<<<<<<<<
8371  * raise ValueError("Empty shape tuple for cython.array")
8372  *
8373  */
8374  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8375  if (unlikely(__pyx_t_2)) {
8376 
8377  /* "View.MemoryView":133
8378  *
8379  * if not self.ndim:
8380  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8381  *
8382  * if itemsize <= 0:
8383  */
8384  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8385  __Pyx_GOTREF(__pyx_t_3);
8386  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8387  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8388  __PYX_ERR(1, 133, __pyx_L1_error)
8389 
8390  /* "View.MemoryView":132
8391  * self.itemsize = itemsize
8392  *
8393  * if not self.ndim: # <<<<<<<<<<<<<<
8394  * raise ValueError("Empty shape tuple for cython.array")
8395  *
8396  */
8397  }
8398 
8399  /* "View.MemoryView":135
8400  * raise ValueError("Empty shape tuple for cython.array")
8401  *
8402  * if itemsize <= 0: # <<<<<<<<<<<<<<
8403  * raise ValueError("itemsize <= 0 for cython.array")
8404  *
8405  */
8406  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8407  if (unlikely(__pyx_t_2)) {
8408 
8409  /* "View.MemoryView":136
8410  *
8411  * if itemsize <= 0:
8412  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8413  *
8414  * if not isinstance(format, bytes):
8415  */
8416  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8417  __Pyx_GOTREF(__pyx_t_3);
8418  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8419  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8420  __PYX_ERR(1, 136, __pyx_L1_error)
8421 
8422  /* "View.MemoryView":135
8423  * raise ValueError("Empty shape tuple for cython.array")
8424  *
8425  * if itemsize <= 0: # <<<<<<<<<<<<<<
8426  * raise ValueError("itemsize <= 0 for cython.array")
8427  *
8428  */
8429  }
8430 
8431  /* "View.MemoryView":138
8432  * raise ValueError("itemsize <= 0 for cython.array")
8433  *
8434  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8435  * format = format.encode('ASCII')
8436  * self._format = format # keep a reference to the byte string
8437  */
8438  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8439  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8440  if (__pyx_t_4) {
8441 
8442  /* "View.MemoryView":139
8443  *
8444  * if not isinstance(format, bytes):
8445  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8446  * self._format = format # keep a reference to the byte string
8447  * self.format = self._format
8448  */
8449  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8450  __Pyx_GOTREF(__pyx_t_5);
8451  __pyx_t_6 = NULL;
8452  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8453  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8454  if (likely(__pyx_t_6)) {
8455  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8456  __Pyx_INCREF(__pyx_t_6);
8457  __Pyx_INCREF(function);
8458  __Pyx_DECREF_SET(__pyx_t_5, function);
8459  }
8460  }
8461  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8462  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8463  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8464  __Pyx_GOTREF(__pyx_t_3);
8465  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8466  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8467  __pyx_t_3 = 0;
8468 
8469  /* "View.MemoryView":138
8470  * raise ValueError("itemsize <= 0 for cython.array")
8471  *
8472  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8473  * format = format.encode('ASCII')
8474  * self._format = format # keep a reference to the byte string
8475  */
8476  }
8477 
8478  /* "View.MemoryView":140
8479  * if not isinstance(format, bytes):
8480  * format = format.encode('ASCII')
8481  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8482  * self.format = self._format
8483  *
8484  */
8485  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8486  __pyx_t_3 = __pyx_v_format;
8487  __Pyx_INCREF(__pyx_t_3);
8488  __Pyx_GIVEREF(__pyx_t_3);
8489  __Pyx_GOTREF(__pyx_v_self->_format);
8490  __Pyx_DECREF(__pyx_v_self->_format);
8491  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8492  __pyx_t_3 = 0;
8493 
8494  /* "View.MemoryView":141
8495  * format = format.encode('ASCII')
8496  * self._format = format # keep a reference to the byte string
8497  * self.format = self._format # <<<<<<<<<<<<<<
8498  *
8499  *
8500  */
8501  if (unlikely(__pyx_v_self->_format == Py_None)) {
8502  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8503  __PYX_ERR(1, 141, __pyx_L1_error)
8504  }
8505  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8506  __pyx_v_self->format = __pyx_t_7;
8507 
8508  /* "View.MemoryView":144
8509  *
8510  *
8511  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8512  * self._strides = self._shape + self.ndim
8513  *
8514  */
8515  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8516 
8517  /* "View.MemoryView":145
8518  *
8519  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8520  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8521  *
8522  * if not self._shape:
8523  */
8524  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8525 
8526  /* "View.MemoryView":147
8527  * self._strides = self._shape + self.ndim
8528  *
8529  * if not self._shape: # <<<<<<<<<<<<<<
8530  * raise MemoryError("unable to allocate shape and strides.")
8531  *
8532  */
8533  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8534  if (unlikely(__pyx_t_4)) {
8535 
8536  /* "View.MemoryView":148
8537  *
8538  * if not self._shape:
8539  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8540  *
8541  *
8542  */
8543  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8544  __Pyx_GOTREF(__pyx_t_3);
8545  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8546  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8547  __PYX_ERR(1, 148, __pyx_L1_error)
8548 
8549  /* "View.MemoryView":147
8550  * self._strides = self._shape + self.ndim
8551  *
8552  * if not self._shape: # <<<<<<<<<<<<<<
8553  * raise MemoryError("unable to allocate shape and strides.")
8554  *
8555  */
8556  }
8557 
8558  /* "View.MemoryView":151
8559  *
8560  *
8561  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8562  * if dim <= 0:
8563  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8564  */
8565  __pyx_t_8 = 0;
8566  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8567  for (;;) {
8568  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8569  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8570  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8571  #else
8572  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8573  __Pyx_GOTREF(__pyx_t_5);
8574  #endif
8575  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8576  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8577  __pyx_v_dim = __pyx_t_9;
8578  __pyx_v_idx = __pyx_t_8;
8579  __pyx_t_8 = (__pyx_t_8 + 1);
8580 
8581  /* "View.MemoryView":152
8582  *
8583  * for idx, dim in enumerate(shape):
8584  * if dim <= 0: # <<<<<<<<<<<<<<
8585  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8586  * self._shape[idx] = dim
8587  */
8588  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8589  if (unlikely(__pyx_t_4)) {
8590 
8591  /* "View.MemoryView":153
8592  * for idx, dim in enumerate(shape):
8593  * if dim <= 0:
8594  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8595  * self._shape[idx] = dim
8596  *
8597  */
8598  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8599  __Pyx_GOTREF(__pyx_t_5);
8600  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8601  __Pyx_GOTREF(__pyx_t_6);
8602  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8603  __Pyx_GOTREF(__pyx_t_10);
8604  __Pyx_GIVEREF(__pyx_t_5);
8605  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8606  __Pyx_GIVEREF(__pyx_t_6);
8607  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8608  __pyx_t_5 = 0;
8609  __pyx_t_6 = 0;
8610  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8611  __Pyx_GOTREF(__pyx_t_6);
8612  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8613  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8614  __Pyx_GOTREF(__pyx_t_10);
8615  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8616  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8617  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8618  __PYX_ERR(1, 153, __pyx_L1_error)
8619 
8620  /* "View.MemoryView":152
8621  *
8622  * for idx, dim in enumerate(shape):
8623  * if dim <= 0: # <<<<<<<<<<<<<<
8624  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8625  * self._shape[idx] = dim
8626  */
8627  }
8628 
8629  /* "View.MemoryView":154
8630  * if dim <= 0:
8631  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8632  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8633  *
8634  * cdef char order
8635  */
8636  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8637 
8638  /* "View.MemoryView":151
8639  *
8640  *
8641  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8642  * if dim <= 0:
8643  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8644  */
8645  }
8646  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8647 
8648  /* "View.MemoryView":157
8649  *
8650  * cdef char order
8651  * if mode == 'fortran': # <<<<<<<<<<<<<<
8652  * order = b'F'
8653  * self.mode = u'fortran'
8654  */
8655  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8656  if (__pyx_t_4) {
8657 
8658  /* "View.MemoryView":158
8659  * cdef char order
8660  * if mode == 'fortran':
8661  * order = b'F' # <<<<<<<<<<<<<<
8662  * self.mode = u'fortran'
8663  * elif mode == 'c':
8664  */
8665  __pyx_v_order = 'F';
8666 
8667  /* "View.MemoryView":159
8668  * if mode == 'fortran':
8669  * order = b'F'
8670  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8671  * elif mode == 'c':
8672  * order = b'C'
8673  */
8674  __Pyx_INCREF(__pyx_n_u_fortran);
8675  __Pyx_GIVEREF(__pyx_n_u_fortran);
8676  __Pyx_GOTREF(__pyx_v_self->mode);
8677  __Pyx_DECREF(__pyx_v_self->mode);
8678  __pyx_v_self->mode = __pyx_n_u_fortran;
8679 
8680  /* "View.MemoryView":157
8681  *
8682  * cdef char order
8683  * if mode == 'fortran': # <<<<<<<<<<<<<<
8684  * order = b'F'
8685  * self.mode = u'fortran'
8686  */
8687  goto __pyx_L10;
8688  }
8689 
8690  /* "View.MemoryView":160
8691  * order = b'F'
8692  * self.mode = u'fortran'
8693  * elif mode == 'c': # <<<<<<<<<<<<<<
8694  * order = b'C'
8695  * self.mode = u'c'
8696  */
8697  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8698  if (likely(__pyx_t_4)) {
8699 
8700  /* "View.MemoryView":161
8701  * self.mode = u'fortran'
8702  * elif mode == 'c':
8703  * order = b'C' # <<<<<<<<<<<<<<
8704  * self.mode = u'c'
8705  * else:
8706  */
8707  __pyx_v_order = 'C';
8708 
8709  /* "View.MemoryView":162
8710  * elif mode == 'c':
8711  * order = b'C'
8712  * self.mode = u'c' # <<<<<<<<<<<<<<
8713  * else:
8714  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8715  */
8716  __Pyx_INCREF(__pyx_n_u_c);
8717  __Pyx_GIVEREF(__pyx_n_u_c);
8718  __Pyx_GOTREF(__pyx_v_self->mode);
8719  __Pyx_DECREF(__pyx_v_self->mode);
8720  __pyx_v_self->mode = __pyx_n_u_c;
8721 
8722  /* "View.MemoryView":160
8723  * order = b'F'
8724  * self.mode = u'fortran'
8725  * elif mode == 'c': # <<<<<<<<<<<<<<
8726  * order = b'C'
8727  * self.mode = u'c'
8728  */
8729  goto __pyx_L10;
8730  }
8731 
8732  /* "View.MemoryView":164
8733  * self.mode = u'c'
8734  * else:
8735  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8736  *
8737  * self.len = fill_contig_strides_array(self._shape, self._strides,
8738  */
8739  /*else*/ {
8740  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8741  __Pyx_GOTREF(__pyx_t_3);
8742  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8743  __Pyx_GOTREF(__pyx_t_10);
8744  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8745  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8746  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8747  __PYX_ERR(1, 164, __pyx_L1_error)
8748  }
8749  __pyx_L10:;
8750 
8751  /* "View.MemoryView":166
8752  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8753  *
8754  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8755  * itemsize, self.ndim, order)
8756  *
8757  */
8758  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8759 
8760  /* "View.MemoryView":169
8761  * itemsize, self.ndim, order)
8762  *
8763  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8764  * self.dtype_is_object = format == b'O'
8765  * if allocate_buffer:
8766  */
8767  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8768 
8769  /* "View.MemoryView":170
8770  *
8771  * self.free_data = allocate_buffer
8772  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8773  * if allocate_buffer:
8774  *
8775  */
8776  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8777  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8778  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8779  __pyx_v_self->dtype_is_object = __pyx_t_4;
8780 
8781  /* "View.MemoryView":171
8782  * self.free_data = allocate_buffer
8783  * self.dtype_is_object = format == b'O'
8784  * if allocate_buffer: # <<<<<<<<<<<<<<
8785  *
8786  *
8787  */
8788  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8789  if (__pyx_t_4) {
8790 
8791  /* "View.MemoryView":174
8792  *
8793  *
8794  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8795  * if not self.data:
8796  * raise MemoryError("unable to allocate array data.")
8797  */
8798  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8799 
8800  /* "View.MemoryView":175
8801  *
8802  * self.data = <char *>malloc(self.len)
8803  * if not self.data: # <<<<<<<<<<<<<<
8804  * raise MemoryError("unable to allocate array data.")
8805  *
8806  */
8807  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8808  if (unlikely(__pyx_t_4)) {
8809 
8810  /* "View.MemoryView":176
8811  * self.data = <char *>malloc(self.len)
8812  * if not self.data:
8813  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8814  *
8815  * if self.dtype_is_object:
8816  */
8817  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8818  __Pyx_GOTREF(__pyx_t_10);
8819  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8820  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8821  __PYX_ERR(1, 176, __pyx_L1_error)
8822 
8823  /* "View.MemoryView":175
8824  *
8825  * self.data = <char *>malloc(self.len)
8826  * if not self.data: # <<<<<<<<<<<<<<
8827  * raise MemoryError("unable to allocate array data.")
8828  *
8829  */
8830  }
8831 
8832  /* "View.MemoryView":178
8833  * raise MemoryError("unable to allocate array data.")
8834  *
8835  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8836  * p = <PyObject **> self.data
8837  * for i in range(self.len / itemsize):
8838  */
8839  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8840  if (__pyx_t_4) {
8841 
8842  /* "View.MemoryView":179
8843  *
8844  * if self.dtype_is_object:
8845  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8846  * for i in range(self.len / itemsize):
8847  * p[i] = Py_None
8848  */
8849  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8850 
8851  /* "View.MemoryView":180
8852  * if self.dtype_is_object:
8853  * p = <PyObject **> self.data
8854  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8855  * p[i] = Py_None
8856  * Py_INCREF(Py_None)
8857  */
8858  if (unlikely(__pyx_v_itemsize == 0)) {
8859  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8860  __PYX_ERR(1, 180, __pyx_L1_error)
8861  }
8862  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8863  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8864  __PYX_ERR(1, 180, __pyx_L1_error)
8865  }
8866  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8867  __pyx_t_9 = __pyx_t_1;
8868  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8869  __pyx_v_i = __pyx_t_11;
8870 
8871  /* "View.MemoryView":181
8872  * p = <PyObject **> self.data
8873  * for i in range(self.len / itemsize):
8874  * p[i] = Py_None # <<<<<<<<<<<<<<
8875  * Py_INCREF(Py_None)
8876  *
8877  */
8878  (__pyx_v_p[__pyx_v_i]) = Py_None;
8879 
8880  /* "View.MemoryView":182
8881  * for i in range(self.len / itemsize):
8882  * p[i] = Py_None
8883  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8884  *
8885  * @cname('getbuffer')
8886  */
8887  Py_INCREF(Py_None);
8888  }
8889 
8890  /* "View.MemoryView":178
8891  * raise MemoryError("unable to allocate array data.")
8892  *
8893  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8894  * p = <PyObject **> self.data
8895  * for i in range(self.len / itemsize):
8896  */
8897  }
8898 
8899  /* "View.MemoryView":171
8900  * self.free_data = allocate_buffer
8901  * self.dtype_is_object = format == b'O'
8902  * if allocate_buffer: # <<<<<<<<<<<<<<
8903  *
8904  *
8905  */
8906  }
8907 
8908  /* "View.MemoryView":122
8909  * cdef bint dtype_is_object
8910  *
8911  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8912  * mode="c", bint allocate_buffer=True):
8913  *
8914  */
8915 
8916  /* function exit code */
8917  __pyx_r = 0;
8918  goto __pyx_L0;
8919  __pyx_L1_error:;
8920  __Pyx_XDECREF(__pyx_t_3);
8921  __Pyx_XDECREF(__pyx_t_5);
8922  __Pyx_XDECREF(__pyx_t_6);
8923  __Pyx_XDECREF(__pyx_t_10);
8924  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8925  __pyx_r = -1;
8926  __pyx_L0:;
8927  __Pyx_XDECREF(__pyx_v_format);
8928  __Pyx_TraceReturn(Py_None, 0);
8929  __Pyx_RefNannyFinishContext();
8930  return __pyx_r;
8931 }
8932 
8933 /* "View.MemoryView":185
8934  *
8935  * @cname('getbuffer')
8936  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8937  * cdef int bufmode = -1
8938  * if self.mode == u"c":
8939  */
8940 
8941 /* Python wrapper */
8942 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8943 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8944  int __pyx_r;
8945  __Pyx_RefNannyDeclarations
8946  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8947  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8948 
8949  /* function exit code */
8950  __Pyx_RefNannyFinishContext();
8951  return __pyx_r;
8952 }
8953 
8954 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8955  int __pyx_v_bufmode;
8956  int __pyx_r;
8957  __Pyx_TraceDeclarations
8958  __Pyx_RefNannyDeclarations
8959  int __pyx_t_1;
8960  int __pyx_t_2;
8961  PyObject *__pyx_t_3 = NULL;
8962  char *__pyx_t_4;
8963  Py_ssize_t __pyx_t_5;
8964  int __pyx_t_6;
8965  Py_ssize_t *__pyx_t_7;
8966  int __pyx_lineno = 0;
8967  const char *__pyx_filename = NULL;
8968  int __pyx_clineno = 0;
8969  if (__pyx_v_info == NULL) {
8970  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8971  return -1;
8972  }
8973  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8974  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8975  __Pyx_GIVEREF(__pyx_v_info->obj);
8976  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8977 
8978  /* "View.MemoryView":186
8979  * @cname('getbuffer')
8980  * def __getbuffer__(self, Py_buffer *info, int flags):
8981  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8982  * if self.mode == u"c":
8983  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8984  */
8985  __pyx_v_bufmode = -1;
8986 
8987  /* "View.MemoryView":187
8988  * def __getbuffer__(self, Py_buffer *info, int flags):
8989  * cdef int bufmode = -1
8990  * if self.mode == u"c": # <<<<<<<<<<<<<<
8991  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8992  * elif self.mode == u"fortran":
8993  */
8994  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8995  __pyx_t_2 = (__pyx_t_1 != 0);
8996  if (__pyx_t_2) {
8997 
8998  /* "View.MemoryView":188
8999  * cdef int bufmode = -1
9000  * if self.mode == u"c":
9001  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9002  * elif self.mode == u"fortran":
9003  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9004  */
9005  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9006 
9007  /* "View.MemoryView":187
9008  * def __getbuffer__(self, Py_buffer *info, int flags):
9009  * cdef int bufmode = -1
9010  * if self.mode == u"c": # <<<<<<<<<<<<<<
9011  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9012  * elif self.mode == u"fortran":
9013  */
9014  goto __pyx_L3;
9015  }
9016 
9017  /* "View.MemoryView":189
9018  * if self.mode == u"c":
9019  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9020  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9021  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9022  * if not (flags & bufmode):
9023  */
9024  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9025  __pyx_t_1 = (__pyx_t_2 != 0);
9026  if (__pyx_t_1) {
9027 
9028  /* "View.MemoryView":190
9029  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9030  * elif self.mode == u"fortran":
9031  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9032  * if not (flags & bufmode):
9033  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9034  */
9035  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9036 
9037  /* "View.MemoryView":189
9038  * if self.mode == u"c":
9039  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9040  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9041  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9042  * if not (flags & bufmode):
9043  */
9044  }
9045  __pyx_L3:;
9046 
9047  /* "View.MemoryView":191
9048  * elif self.mode == u"fortran":
9049  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9050  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9051  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9052  * info.buf = self.data
9053  */
9054  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9055  if (unlikely(__pyx_t_1)) {
9056 
9057  /* "View.MemoryView":192
9058  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9059  * if not (flags & bufmode):
9060  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9061  * info.buf = self.data
9062  * info.len = self.len
9063  */
9064  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9065  __Pyx_GOTREF(__pyx_t_3);
9066  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9067  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9068  __PYX_ERR(1, 192, __pyx_L1_error)
9069 
9070  /* "View.MemoryView":191
9071  * elif self.mode == u"fortran":
9072  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9073  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9074  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9075  * info.buf = self.data
9076  */
9077  }
9078 
9079  /* "View.MemoryView":193
9080  * if not (flags & bufmode):
9081  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9082  * info.buf = self.data # <<<<<<<<<<<<<<
9083  * info.len = self.len
9084  * info.ndim = self.ndim
9085  */
9086  __pyx_t_4 = __pyx_v_self->data;
9087  __pyx_v_info->buf = __pyx_t_4;
9088 
9089  /* "View.MemoryView":194
9090  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9091  * info.buf = self.data
9092  * info.len = self.len # <<<<<<<<<<<<<<
9093  * info.ndim = self.ndim
9094  * info.shape = self._shape
9095  */
9096  __pyx_t_5 = __pyx_v_self->len;
9097  __pyx_v_info->len = __pyx_t_5;
9098 
9099  /* "View.MemoryView":195
9100  * info.buf = self.data
9101  * info.len = self.len
9102  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9103  * info.shape = self._shape
9104  * info.strides = self._strides
9105  */
9106  __pyx_t_6 = __pyx_v_self->ndim;
9107  __pyx_v_info->ndim = __pyx_t_6;
9108 
9109  /* "View.MemoryView":196
9110  * info.len = self.len
9111  * info.ndim = self.ndim
9112  * info.shape = self._shape # <<<<<<<<<<<<<<
9113  * info.strides = self._strides
9114  * info.suboffsets = NULL
9115  */
9116  __pyx_t_7 = __pyx_v_self->_shape;
9117  __pyx_v_info->shape = __pyx_t_7;
9118 
9119  /* "View.MemoryView":197
9120  * info.ndim = self.ndim
9121  * info.shape = self._shape
9122  * info.strides = self._strides # <<<<<<<<<<<<<<
9123  * info.suboffsets = NULL
9124  * info.itemsize = self.itemsize
9125  */
9126  __pyx_t_7 = __pyx_v_self->_strides;
9127  __pyx_v_info->strides = __pyx_t_7;
9128 
9129  /* "View.MemoryView":198
9130  * info.shape = self._shape
9131  * info.strides = self._strides
9132  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9133  * info.itemsize = self.itemsize
9134  * info.readonly = 0
9135  */
9136  __pyx_v_info->suboffsets = NULL;
9137 
9138  /* "View.MemoryView":199
9139  * info.strides = self._strides
9140  * info.suboffsets = NULL
9141  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9142  * info.readonly = 0
9143  *
9144  */
9145  __pyx_t_5 = __pyx_v_self->itemsize;
9146  __pyx_v_info->itemsize = __pyx_t_5;
9147 
9148  /* "View.MemoryView":200
9149  * info.suboffsets = NULL
9150  * info.itemsize = self.itemsize
9151  * info.readonly = 0 # <<<<<<<<<<<<<<
9152  *
9153  * if flags & PyBUF_FORMAT:
9154  */
9155  __pyx_v_info->readonly = 0;
9156 
9157  /* "View.MemoryView":202
9158  * info.readonly = 0
9159  *
9160  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9161  * info.format = self.format
9162  * else:
9163  */
9164  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9165  if (__pyx_t_1) {
9166 
9167  /* "View.MemoryView":203
9168  *
9169  * if flags & PyBUF_FORMAT:
9170  * info.format = self.format # <<<<<<<<<<<<<<
9171  * else:
9172  * info.format = NULL
9173  */
9174  __pyx_t_4 = __pyx_v_self->format;
9175  __pyx_v_info->format = __pyx_t_4;
9176 
9177  /* "View.MemoryView":202
9178  * info.readonly = 0
9179  *
9180  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9181  * info.format = self.format
9182  * else:
9183  */
9184  goto __pyx_L5;
9185  }
9186 
9187  /* "View.MemoryView":205
9188  * info.format = self.format
9189  * else:
9190  * info.format = NULL # <<<<<<<<<<<<<<
9191  *
9192  * info.obj = self
9193  */
9194  /*else*/ {
9195  __pyx_v_info->format = NULL;
9196  }
9197  __pyx_L5:;
9198 
9199  /* "View.MemoryView":207
9200  * info.format = NULL
9201  *
9202  * info.obj = self # <<<<<<<<<<<<<<
9203  *
9204  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9205  */
9206  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9207  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9208  __Pyx_GOTREF(__pyx_v_info->obj);
9209  __Pyx_DECREF(__pyx_v_info->obj);
9210  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9211 
9212  /* "View.MemoryView":185
9213  *
9214  * @cname('getbuffer')
9215  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9216  * cdef int bufmode = -1
9217  * if self.mode == u"c":
9218  */
9219 
9220  /* function exit code */
9221  __pyx_r = 0;
9222  goto __pyx_L0;
9223  __pyx_L1_error:;
9224  __Pyx_XDECREF(__pyx_t_3);
9225  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9226  __pyx_r = -1;
9227  if (__pyx_v_info->obj != NULL) {
9228  __Pyx_GOTREF(__pyx_v_info->obj);
9229  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9230  }
9231  goto __pyx_L2;
9232  __pyx_L0:;
9233  if (__pyx_v_info->obj == Py_None) {
9234  __Pyx_GOTREF(__pyx_v_info->obj);
9235  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9236  }
9237  __pyx_L2:;
9238  __Pyx_TraceReturn(Py_None, 0);
9239  __Pyx_RefNannyFinishContext();
9240  return __pyx_r;
9241 }
9242 
9243 /* "View.MemoryView":211
9244  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9245  *
9246  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9247  * if self.callback_free_data != NULL:
9248  * self.callback_free_data(self.data)
9249  */
9250 
9251 /* Python wrapper */
9252 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9253 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9254  __Pyx_RefNannyDeclarations
9255  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9256  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9257 
9258  /* function exit code */
9259  __Pyx_RefNannyFinishContext();
9260 }
9261 
9262 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9263  __Pyx_TraceDeclarations
9264  __Pyx_RefNannyDeclarations
9265  int __pyx_t_1;
9266  int __pyx_lineno = 0;
9267  const char *__pyx_filename = NULL;
9268  int __pyx_clineno = 0;
9269  __Pyx_RefNannySetupContext("__dealloc__", 0);
9270  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
9271 
9272  /* "View.MemoryView":212
9273  *
9274  * def __dealloc__(array self):
9275  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9276  * self.callback_free_data(self.data)
9277  * elif self.free_data:
9278  */
9279  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9280  if (__pyx_t_1) {
9281 
9282  /* "View.MemoryView":213
9283  * def __dealloc__(array self):
9284  * if self.callback_free_data != NULL:
9285  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9286  * elif self.free_data:
9287  * if self.dtype_is_object:
9288  */
9289  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9290 
9291  /* "View.MemoryView":212
9292  *
9293  * def __dealloc__(array self):
9294  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9295  * self.callback_free_data(self.data)
9296  * elif self.free_data:
9297  */
9298  goto __pyx_L3;
9299  }
9300 
9301  /* "View.MemoryView":214
9302  * if self.callback_free_data != NULL:
9303  * self.callback_free_data(self.data)
9304  * elif self.free_data: # <<<<<<<<<<<<<<
9305  * if self.dtype_is_object:
9306  * refcount_objects_in_slice(self.data, self._shape,
9307  */
9308  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9309  if (__pyx_t_1) {
9310 
9311  /* "View.MemoryView":215
9312  * self.callback_free_data(self.data)
9313  * elif self.free_data:
9314  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9315  * refcount_objects_in_slice(self.data, self._shape,
9316  * self._strides, self.ndim, False)
9317  */
9318  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9319  if (__pyx_t_1) {
9320 
9321  /* "View.MemoryView":216
9322  * elif self.free_data:
9323  * if self.dtype_is_object:
9324  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9325  * self._strides, self.ndim, False)
9326  * free(self.data)
9327  */
9328  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9329 
9330  /* "View.MemoryView":215
9331  * self.callback_free_data(self.data)
9332  * elif self.free_data:
9333  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9334  * refcount_objects_in_slice(self.data, self._shape,
9335  * self._strides, self.ndim, False)
9336  */
9337  }
9338 
9339  /* "View.MemoryView":218
9340  * refcount_objects_in_slice(self.data, self._shape,
9341  * self._strides, self.ndim, False)
9342  * free(self.data) # <<<<<<<<<<<<<<
9343  * PyObject_Free(self._shape)
9344  *
9345  */
9346  free(__pyx_v_self->data);
9347 
9348  /* "View.MemoryView":214
9349  * if self.callback_free_data != NULL:
9350  * self.callback_free_data(self.data)
9351  * elif self.free_data: # <<<<<<<<<<<<<<
9352  * if self.dtype_is_object:
9353  * refcount_objects_in_slice(self.data, self._shape,
9354  */
9355  }
9356  __pyx_L3:;
9357 
9358  /* "View.MemoryView":219
9359  * self._strides, self.ndim, False)
9360  * free(self.data)
9361  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9362  *
9363  * @property
9364  */
9365  PyObject_Free(__pyx_v_self->_shape);
9366 
9367  /* "View.MemoryView":211
9368  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9369  *
9370  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9371  * if self.callback_free_data != NULL:
9372  * self.callback_free_data(self.data)
9373  */
9374 
9375  /* function exit code */
9376  goto __pyx_L0;
9377  __pyx_L1_error:;
9378  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9379  __pyx_L0:;
9380  __Pyx_TraceReturn(Py_None, 0);
9381  __Pyx_RefNannyFinishContext();
9382 }
9383 
9384 /* "View.MemoryView":222
9385  *
9386  * @property
9387  * def memview(self): # <<<<<<<<<<<<<<
9388  * return self.get_memview()
9389  *
9390  */
9391 
9392 /* Python wrapper */
9393 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9394 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9395  PyObject *__pyx_r = 0;
9396  __Pyx_RefNannyDeclarations
9397  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9398  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9399 
9400  /* function exit code */
9401  __Pyx_RefNannyFinishContext();
9402  return __pyx_r;
9403 }
9404 
9405 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9406  PyObject *__pyx_r = NULL;
9407  __Pyx_TraceDeclarations
9408  __Pyx_RefNannyDeclarations
9409  PyObject *__pyx_t_1 = NULL;
9410  int __pyx_lineno = 0;
9411  const char *__pyx_filename = NULL;
9412  int __pyx_clineno = 0;
9413  __Pyx_RefNannySetupContext("__get__", 0);
9414  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
9415 
9416  /* "View.MemoryView":223
9417  * @property
9418  * def memview(self):
9419  * return self.get_memview() # <<<<<<<<<<<<<<
9420  *
9421  * @cname('get_memview')
9422  */
9423  __Pyx_XDECREF(__pyx_r);
9424  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9425  __Pyx_GOTREF(__pyx_t_1);
9426  __pyx_r = __pyx_t_1;
9427  __pyx_t_1 = 0;
9428  goto __pyx_L0;
9429 
9430  /* "View.MemoryView":222
9431  *
9432  * @property
9433  * def memview(self): # <<<<<<<<<<<<<<
9434  * return self.get_memview()
9435  *
9436  */
9437 
9438  /* function exit code */
9439  __pyx_L1_error:;
9440  __Pyx_XDECREF(__pyx_t_1);
9441  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9442  __pyx_r = NULL;
9443  __pyx_L0:;
9444  __Pyx_XGIVEREF(__pyx_r);
9445  __Pyx_TraceReturn(__pyx_r, 0);
9446  __Pyx_RefNannyFinishContext();
9447  return __pyx_r;
9448 }
9449 
9450 /* "View.MemoryView":226
9451  *
9452  * @cname('get_memview')
9453  * cdef get_memview(self): # <<<<<<<<<<<<<<
9454  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9455  * return memoryview(self, flags, self.dtype_is_object)
9456  */
9457 
9458 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9459  int __pyx_v_flags;
9460  PyObject *__pyx_r = NULL;
9461  __Pyx_TraceDeclarations
9462  __Pyx_RefNannyDeclarations
9463  PyObject *__pyx_t_1 = NULL;
9464  PyObject *__pyx_t_2 = NULL;
9465  PyObject *__pyx_t_3 = NULL;
9466  int __pyx_lineno = 0;
9467  const char *__pyx_filename = NULL;
9468  int __pyx_clineno = 0;
9469  __Pyx_RefNannySetupContext("get_memview", 0);
9470  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
9471 
9472  /* "View.MemoryView":227
9473  * @cname('get_memview')
9474  * cdef get_memview(self):
9475  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9476  * return memoryview(self, flags, self.dtype_is_object)
9477  *
9478  */
9479  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9480 
9481  /* "View.MemoryView":228
9482  * cdef get_memview(self):
9483  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9484  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9485  *
9486  * def __len__(self):
9487  */
9488  __Pyx_XDECREF(__pyx_r);
9489  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9490  __Pyx_GOTREF(__pyx_t_1);
9491  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9492  __Pyx_GOTREF(__pyx_t_2);
9493  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9494  __Pyx_GOTREF(__pyx_t_3);
9495  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9496  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9497  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9498  __Pyx_GIVEREF(__pyx_t_1);
9499  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9500  __Pyx_GIVEREF(__pyx_t_2);
9501  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9502  __pyx_t_1 = 0;
9503  __pyx_t_2 = 0;
9504  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9505  __Pyx_GOTREF(__pyx_t_2);
9506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9507  __pyx_r = __pyx_t_2;
9508  __pyx_t_2 = 0;
9509  goto __pyx_L0;
9510 
9511  /* "View.MemoryView":226
9512  *
9513  * @cname('get_memview')
9514  * cdef get_memview(self): # <<<<<<<<<<<<<<
9515  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9516  * return memoryview(self, flags, self.dtype_is_object)
9517  */
9518 
9519  /* function exit code */
9520  __pyx_L1_error:;
9521  __Pyx_XDECREF(__pyx_t_1);
9522  __Pyx_XDECREF(__pyx_t_2);
9523  __Pyx_XDECREF(__pyx_t_3);
9524  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9525  __pyx_r = 0;
9526  __pyx_L0:;
9527  __Pyx_XGIVEREF(__pyx_r);
9528  __Pyx_TraceReturn(__pyx_r, 0);
9529  __Pyx_RefNannyFinishContext();
9530  return __pyx_r;
9531 }
9532 
9533 /* "View.MemoryView":230
9534  * return memoryview(self, flags, self.dtype_is_object)
9535  *
9536  * def __len__(self): # <<<<<<<<<<<<<<
9537  * return self._shape[0]
9538  *
9539  */
9540 
9541 /* Python wrapper */
9542 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9543 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9544  Py_ssize_t __pyx_r;
9545  __Pyx_RefNannyDeclarations
9546  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9547  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9548 
9549  /* function exit code */
9550  __Pyx_RefNannyFinishContext();
9551  return __pyx_r;
9552 }
9553 
9554 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9555  Py_ssize_t __pyx_r;
9556  __Pyx_TraceDeclarations
9557  __Pyx_RefNannyDeclarations
9558  int __pyx_lineno = 0;
9559  const char *__pyx_filename = NULL;
9560  int __pyx_clineno = 0;
9561  __Pyx_RefNannySetupContext("__len__", 0);
9562  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9563 
9564  /* "View.MemoryView":231
9565  *
9566  * def __len__(self):
9567  * return self._shape[0] # <<<<<<<<<<<<<<
9568  *
9569  * def __getattr__(self, attr):
9570  */
9571  __pyx_r = (__pyx_v_self->_shape[0]);
9572  goto __pyx_L0;
9573 
9574  /* "View.MemoryView":230
9575  * return memoryview(self, flags, self.dtype_is_object)
9576  *
9577  * def __len__(self): # <<<<<<<<<<<<<<
9578  * return self._shape[0]
9579  *
9580  */
9581 
9582  /* function exit code */
9583  __pyx_L1_error:;
9584  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9585  __pyx_r = -1;
9586  __pyx_L0:;
9587  __Pyx_TraceReturn(Py_None, 0);
9588  __Pyx_RefNannyFinishContext();
9589  return __pyx_r;
9590 }
9591 
9592 /* "View.MemoryView":233
9593  * return self._shape[0]
9594  *
9595  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9596  * return getattr(self.memview, attr)
9597  *
9598  */
9599 
9600 /* Python wrapper */
9601 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9602 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9603  PyObject *__pyx_r = 0;
9604  __Pyx_RefNannyDeclarations
9605  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9606  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9607 
9608  /* function exit code */
9609  __Pyx_RefNannyFinishContext();
9610  return __pyx_r;
9611 }
9612 
9613 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9614  PyObject *__pyx_r = NULL;
9615  __Pyx_TraceDeclarations
9616  __Pyx_RefNannyDeclarations
9617  PyObject *__pyx_t_1 = NULL;
9618  PyObject *__pyx_t_2 = NULL;
9619  int __pyx_lineno = 0;
9620  const char *__pyx_filename = NULL;
9621  int __pyx_clineno = 0;
9622  __Pyx_RefNannySetupContext("__getattr__", 0);
9623  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9624 
9625  /* "View.MemoryView":234
9626  *
9627  * def __getattr__(self, attr):
9628  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9629  *
9630  * def __getitem__(self, item):
9631  */
9632  __Pyx_XDECREF(__pyx_r);
9633  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9634  __Pyx_GOTREF(__pyx_t_1);
9635  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9636  __Pyx_GOTREF(__pyx_t_2);
9637  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9638  __pyx_r = __pyx_t_2;
9639  __pyx_t_2 = 0;
9640  goto __pyx_L0;
9641 
9642  /* "View.MemoryView":233
9643  * return self._shape[0]
9644  *
9645  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9646  * return getattr(self.memview, attr)
9647  *
9648  */
9649 
9650  /* function exit code */
9651  __pyx_L1_error:;
9652  __Pyx_XDECREF(__pyx_t_1);
9653  __Pyx_XDECREF(__pyx_t_2);
9654  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9655  __pyx_r = NULL;
9656  __pyx_L0:;
9657  __Pyx_XGIVEREF(__pyx_r);
9658  __Pyx_TraceReturn(__pyx_r, 0);
9659  __Pyx_RefNannyFinishContext();
9660  return __pyx_r;
9661 }
9662 
9663 /* "View.MemoryView":236
9664  * return getattr(self.memview, attr)
9665  *
9666  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9667  * return self.memview[item]
9668  *
9669  */
9670 
9671 /* Python wrapper */
9672 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9673 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9674  PyObject *__pyx_r = 0;
9675  __Pyx_RefNannyDeclarations
9676  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9677  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9678 
9679  /* function exit code */
9680  __Pyx_RefNannyFinishContext();
9681  return __pyx_r;
9682 }
9683 
9684 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9685  PyObject *__pyx_r = NULL;
9686  __Pyx_TraceDeclarations
9687  __Pyx_RefNannyDeclarations
9688  PyObject *__pyx_t_1 = NULL;
9689  PyObject *__pyx_t_2 = NULL;
9690  int __pyx_lineno = 0;
9691  const char *__pyx_filename = NULL;
9692  int __pyx_clineno = 0;
9693  __Pyx_RefNannySetupContext("__getitem__", 0);
9694  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9695 
9696  /* "View.MemoryView":237
9697  *
9698  * def __getitem__(self, item):
9699  * return self.memview[item] # <<<<<<<<<<<<<<
9700  *
9701  * def __setitem__(self, item, value):
9702  */
9703  __Pyx_XDECREF(__pyx_r);
9704  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9705  __Pyx_GOTREF(__pyx_t_1);
9706  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9707  __Pyx_GOTREF(__pyx_t_2);
9708  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9709  __pyx_r = __pyx_t_2;
9710  __pyx_t_2 = 0;
9711  goto __pyx_L0;
9712 
9713  /* "View.MemoryView":236
9714  * return getattr(self.memview, attr)
9715  *
9716  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9717  * return self.memview[item]
9718  *
9719  */
9720 
9721  /* function exit code */
9722  __pyx_L1_error:;
9723  __Pyx_XDECREF(__pyx_t_1);
9724  __Pyx_XDECREF(__pyx_t_2);
9725  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9726  __pyx_r = NULL;
9727  __pyx_L0:;
9728  __Pyx_XGIVEREF(__pyx_r);
9729  __Pyx_TraceReturn(__pyx_r, 0);
9730  __Pyx_RefNannyFinishContext();
9731  return __pyx_r;
9732 }
9733 
9734 /* "View.MemoryView":239
9735  * return self.memview[item]
9736  *
9737  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9738  * self.memview[item] = value
9739  *
9740  */
9741 
9742 /* Python wrapper */
9743 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9744 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9745  int __pyx_r;
9746  __Pyx_RefNannyDeclarations
9747  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9748  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9749 
9750  /* function exit code */
9751  __Pyx_RefNannyFinishContext();
9752  return __pyx_r;
9753 }
9754 
9755 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9756  int __pyx_r;
9757  __Pyx_TraceDeclarations
9758  __Pyx_RefNannyDeclarations
9759  PyObject *__pyx_t_1 = NULL;
9760  int __pyx_lineno = 0;
9761  const char *__pyx_filename = NULL;
9762  int __pyx_clineno = 0;
9763  __Pyx_RefNannySetupContext("__setitem__", 0);
9764  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9765 
9766  /* "View.MemoryView":240
9767  *
9768  * def __setitem__(self, item, value):
9769  * self.memview[item] = value # <<<<<<<<<<<<<<
9770  *
9771  *
9772  */
9773  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9774  __Pyx_GOTREF(__pyx_t_1);
9775  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9776  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9777 
9778  /* "View.MemoryView":239
9779  * return self.memview[item]
9780  *
9781  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9782  * self.memview[item] = value
9783  *
9784  */
9785 
9786  /* function exit code */
9787  __pyx_r = 0;
9788  goto __pyx_L0;
9789  __pyx_L1_error:;
9790  __Pyx_XDECREF(__pyx_t_1);
9791  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9792  __pyx_r = -1;
9793  __pyx_L0:;
9794  __Pyx_TraceReturn(Py_None, 0);
9795  __Pyx_RefNannyFinishContext();
9796  return __pyx_r;
9797 }
9798 
9799 /* "(tree fragment)":1
9800  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9801  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9802  * def __setstate_cython__(self, __pyx_state):
9803  */
9804 
9805 /* Python wrapper */
9806 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9807 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9808 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9809  PyObject *__pyx_r = 0;
9810  __Pyx_RefNannyDeclarations
9811  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9812  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9813 
9814  /* function exit code */
9815  __Pyx_RefNannyFinishContext();
9816  return __pyx_r;
9817 }
9818 
9819 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9820  PyObject *__pyx_r = NULL;
9821  __Pyx_TraceDeclarations
9822  __Pyx_RefNannyDeclarations
9823  PyObject *__pyx_t_1 = NULL;
9824  int __pyx_lineno = 0;
9825  const char *__pyx_filename = NULL;
9826  int __pyx_clineno = 0;
9827  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9828  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9829 
9830  /* "(tree fragment)":2
9831  * def __reduce_cython__(self):
9832  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9833  * def __setstate_cython__(self, __pyx_state):
9834  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9835  */
9836  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9837  __Pyx_GOTREF(__pyx_t_1);
9838  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9839  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9840  __PYX_ERR(1, 2, __pyx_L1_error)
9841 
9842  /* "(tree fragment)":1
9843  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9844  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9845  * def __setstate_cython__(self, __pyx_state):
9846  */
9847 
9848  /* function exit code */
9849  __pyx_L1_error:;
9850  __Pyx_XDECREF(__pyx_t_1);
9851  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9852  __pyx_r = NULL;
9853  __Pyx_XGIVEREF(__pyx_r);
9854  __Pyx_TraceReturn(__pyx_r, 0);
9855  __Pyx_RefNannyFinishContext();
9856  return __pyx_r;
9857 }
9858 
9859 /* "(tree fragment)":3
9860  * def __reduce_cython__(self):
9861  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9862  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9863  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9864  */
9865 
9866 /* Python wrapper */
9867 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9868 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9869 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9870  PyObject *__pyx_r = 0;
9871  __Pyx_RefNannyDeclarations
9872  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9873  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9874 
9875  /* function exit code */
9876  __Pyx_RefNannyFinishContext();
9877  return __pyx_r;
9878 }
9879 
9880 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9881  PyObject *__pyx_r = NULL;
9882  __Pyx_TraceDeclarations
9883  __Pyx_RefNannyDeclarations
9884  PyObject *__pyx_t_1 = NULL;
9885  int __pyx_lineno = 0;
9886  const char *__pyx_filename = NULL;
9887  int __pyx_clineno = 0;
9888  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9889  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9890 
9891  /* "(tree fragment)":4
9892  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9893  * def __setstate_cython__(self, __pyx_state):
9894  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9895  */
9896  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9897  __Pyx_GOTREF(__pyx_t_1);
9898  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9899  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9900  __PYX_ERR(1, 4, __pyx_L1_error)
9901 
9902  /* "(tree fragment)":3
9903  * def __reduce_cython__(self):
9904  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9905  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9906  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9907  */
9908 
9909  /* function exit code */
9910  __pyx_L1_error:;
9911  __Pyx_XDECREF(__pyx_t_1);
9912  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9913  __pyx_r = NULL;
9914  __Pyx_XGIVEREF(__pyx_r);
9915  __Pyx_TraceReturn(__pyx_r, 0);
9916  __Pyx_RefNannyFinishContext();
9917  return __pyx_r;
9918 }
9919 
9920 /* "View.MemoryView":244
9921  *
9922  * @cname("__pyx_array_new")
9923  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9924  * char *mode, char *buf):
9925  * cdef array result
9926  */
9927 
9928 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9929  struct __pyx_array_obj *__pyx_v_result = 0;
9930  struct __pyx_array_obj *__pyx_r = NULL;
9931  __Pyx_TraceDeclarations
9932  __Pyx_RefNannyDeclarations
9933  int __pyx_t_1;
9934  PyObject *__pyx_t_2 = NULL;
9935  PyObject *__pyx_t_3 = NULL;
9936  PyObject *__pyx_t_4 = NULL;
9937  PyObject *__pyx_t_5 = NULL;
9938  int __pyx_lineno = 0;
9939  const char *__pyx_filename = NULL;
9940  int __pyx_clineno = 0;
9941  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9942  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9943 
9944  /* "View.MemoryView":248
9945  * cdef array result
9946  *
9947  * if buf == NULL: # <<<<<<<<<<<<<<
9948  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9949  * else:
9950  */
9951  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9952  if (__pyx_t_1) {
9953 
9954  /* "View.MemoryView":249
9955  *
9956  * if buf == NULL:
9957  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9958  * else:
9959  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9960  */
9961  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9962  __Pyx_GOTREF(__pyx_t_2);
9963  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9964  __Pyx_GOTREF(__pyx_t_3);
9965  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9966  __Pyx_GOTREF(__pyx_t_4);
9967  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9968  __Pyx_GOTREF(__pyx_t_5);
9969  __Pyx_INCREF(__pyx_v_shape);
9970  __Pyx_GIVEREF(__pyx_v_shape);
9971  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9972  __Pyx_GIVEREF(__pyx_t_2);
9973  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9974  __Pyx_GIVEREF(__pyx_t_3);
9975  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9976  __Pyx_GIVEREF(__pyx_t_4);
9977  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9978  __pyx_t_2 = 0;
9979  __pyx_t_3 = 0;
9980  __pyx_t_4 = 0;
9981  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9982  __Pyx_GOTREF(__pyx_t_4);
9983  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9984  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9985  __pyx_t_4 = 0;
9986 
9987  /* "View.MemoryView":248
9988  * cdef array result
9989  *
9990  * if buf == NULL: # <<<<<<<<<<<<<<
9991  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9992  * else:
9993  */
9994  goto __pyx_L3;
9995  }
9996 
9997  /* "View.MemoryView":251
9998  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9999  * else:
10000  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10001  * allocate_buffer=False)
10002  * result.data = buf
10003  */
10004  /*else*/ {
10005  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10006  __Pyx_GOTREF(__pyx_t_4);
10007  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10008  __Pyx_GOTREF(__pyx_t_5);
10009  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10010  __Pyx_GOTREF(__pyx_t_3);
10011  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10012  __Pyx_GOTREF(__pyx_t_2);
10013  __Pyx_INCREF(__pyx_v_shape);
10014  __Pyx_GIVEREF(__pyx_v_shape);
10015  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10016  __Pyx_GIVEREF(__pyx_t_4);
10017  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10018  __Pyx_GIVEREF(__pyx_t_5);
10019  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10020  __Pyx_GIVEREF(__pyx_t_3);
10021  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10022  __pyx_t_4 = 0;
10023  __pyx_t_5 = 0;
10024  __pyx_t_3 = 0;
10025 
10026  /* "View.MemoryView":252
10027  * else:
10028  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10029  * allocate_buffer=False) # <<<<<<<<<<<<<<
10030  * result.data = buf
10031  *
10032  */
10033  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10034  __Pyx_GOTREF(__pyx_t_3);
10035  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10036 
10037  /* "View.MemoryView":251
10038  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10039  * else:
10040  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10041  * allocate_buffer=False)
10042  * result.data = buf
10043  */
10044  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10045  __Pyx_GOTREF(__pyx_t_5);
10046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10047  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10048  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10049  __pyx_t_5 = 0;
10050 
10051  /* "View.MemoryView":253
10052  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10053  * allocate_buffer=False)
10054  * result.data = buf # <<<<<<<<<<<<<<
10055  *
10056  * return result
10057  */
10058  __pyx_v_result->data = __pyx_v_buf;
10059  }
10060  __pyx_L3:;
10061 
10062  /* "View.MemoryView":255
10063  * result.data = buf
10064  *
10065  * return result # <<<<<<<<<<<<<<
10066  *
10067  *
10068  */
10069  __Pyx_XDECREF(((PyObject *)__pyx_r));
10070  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10071  __pyx_r = __pyx_v_result;
10072  goto __pyx_L0;
10073 
10074  /* "View.MemoryView":244
10075  *
10076  * @cname("__pyx_array_new")
10077  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10078  * char *mode, char *buf):
10079  * cdef array result
10080  */
10081 
10082  /* function exit code */
10083  __pyx_L1_error:;
10084  __Pyx_XDECREF(__pyx_t_2);
10085  __Pyx_XDECREF(__pyx_t_3);
10086  __Pyx_XDECREF(__pyx_t_4);
10087  __Pyx_XDECREF(__pyx_t_5);
10088  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10089  __pyx_r = 0;
10090  __pyx_L0:;
10091  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10092  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10093  __Pyx_TraceReturn(__pyx_r, 0);
10094  __Pyx_RefNannyFinishContext();
10095  return __pyx_r;
10096 }
10097 
10098 /* "View.MemoryView":281
10099  * cdef class Enum(object):
10100  * cdef object name
10101  * def __init__(self, name): # <<<<<<<<<<<<<<
10102  * self.name = name
10103  * def __repr__(self):
10104  */
10105 
10106 /* Python wrapper */
10107 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10108 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10109  PyObject *__pyx_v_name = 0;
10110  int __pyx_lineno = 0;
10111  const char *__pyx_filename = NULL;
10112  int __pyx_clineno = 0;
10113  int __pyx_r;
10114  __Pyx_RefNannyDeclarations
10115  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10116  {
10117  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10118  PyObject* values[1] = {0};
10119  if (unlikely(__pyx_kwds)) {
10120  Py_ssize_t kw_args;
10121  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10122  switch (pos_args) {
10123  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10124  CYTHON_FALLTHROUGH;
10125  case 0: break;
10126  default: goto __pyx_L5_argtuple_error;
10127  }
10128  kw_args = PyDict_Size(__pyx_kwds);
10129  switch (pos_args) {
10130  case 0:
10131  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10132  else goto __pyx_L5_argtuple_error;
10133  }
10134  if (unlikely(kw_args > 0)) {
10135  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10136  }
10137  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10138  goto __pyx_L5_argtuple_error;
10139  } else {
10140  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10141  }
10142  __pyx_v_name = values[0];
10143  }
10144  goto __pyx_L4_argument_unpacking_done;
10145  __pyx_L5_argtuple_error:;
10146  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10147  __pyx_L3_error:;
10148  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10149  __Pyx_RefNannyFinishContext();
10150  return -1;
10151  __pyx_L4_argument_unpacking_done:;
10152  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10153 
10154  /* function exit code */
10155  __Pyx_RefNannyFinishContext();
10156  return __pyx_r;
10157 }
10158 
10159 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10160  int __pyx_r;
10161  __Pyx_TraceDeclarations
10162  __Pyx_RefNannyDeclarations
10163  int __pyx_lineno = 0;
10164  const char *__pyx_filename = NULL;
10165  int __pyx_clineno = 0;
10166  __Pyx_RefNannySetupContext("__init__", 0);
10167  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
10168 
10169  /* "View.MemoryView":282
10170  * cdef object name
10171  * def __init__(self, name):
10172  * self.name = name # <<<<<<<<<<<<<<
10173  * def __repr__(self):
10174  * return self.name
10175  */
10176  __Pyx_INCREF(__pyx_v_name);
10177  __Pyx_GIVEREF(__pyx_v_name);
10178  __Pyx_GOTREF(__pyx_v_self->name);
10179  __Pyx_DECREF(__pyx_v_self->name);
10180  __pyx_v_self->name = __pyx_v_name;
10181 
10182  /* "View.MemoryView":281
10183  * cdef class Enum(object):
10184  * cdef object name
10185  * def __init__(self, name): # <<<<<<<<<<<<<<
10186  * self.name = name
10187  * def __repr__(self):
10188  */
10189 
10190  /* function exit code */
10191  __pyx_r = 0;
10192  goto __pyx_L0;
10193  __pyx_L1_error:;
10194  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10195  __pyx_r = -1;
10196  __pyx_L0:;
10197  __Pyx_TraceReturn(Py_None, 0);
10198  __Pyx_RefNannyFinishContext();
10199  return __pyx_r;
10200 }
10201 
10202 /* "View.MemoryView":283
10203  * def __init__(self, name):
10204  * self.name = name
10205  * def __repr__(self): # <<<<<<<<<<<<<<
10206  * return self.name
10207  *
10208  */
10209 
10210 /* Python wrapper */
10211 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10212 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10213  PyObject *__pyx_r = 0;
10214  __Pyx_RefNannyDeclarations
10215  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10216  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10217 
10218  /* function exit code */
10219  __Pyx_RefNannyFinishContext();
10220  return __pyx_r;
10221 }
10222 
10223 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10224  PyObject *__pyx_r = NULL;
10225  __Pyx_TraceDeclarations
10226  __Pyx_RefNannyDeclarations
10227  int __pyx_lineno = 0;
10228  const char *__pyx_filename = NULL;
10229  int __pyx_clineno = 0;
10230  __Pyx_RefNannySetupContext("__repr__", 0);
10231  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
10232 
10233  /* "View.MemoryView":284
10234  * self.name = name
10235  * def __repr__(self):
10236  * return self.name # <<<<<<<<<<<<<<
10237  *
10238  * cdef generic = Enum("<strided and direct or indirect>")
10239  */
10240  __Pyx_XDECREF(__pyx_r);
10241  __Pyx_INCREF(__pyx_v_self->name);
10242  __pyx_r = __pyx_v_self->name;
10243  goto __pyx_L0;
10244 
10245  /* "View.MemoryView":283
10246  * def __init__(self, name):
10247  * self.name = name
10248  * def __repr__(self): # <<<<<<<<<<<<<<
10249  * return self.name
10250  *
10251  */
10252 
10253  /* function exit code */
10254  __pyx_L1_error:;
10255  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10256  __pyx_r = NULL;
10257  __pyx_L0:;
10258  __Pyx_XGIVEREF(__pyx_r);
10259  __Pyx_TraceReturn(__pyx_r, 0);
10260  __Pyx_RefNannyFinishContext();
10261  return __pyx_r;
10262 }
10263 
10264 /* "(tree fragment)":1
10265  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10266  * cdef tuple state
10267  * cdef object _dict
10268  */
10269 
10270 /* Python wrapper */
10271 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10272 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10273 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10274  PyObject *__pyx_r = 0;
10275  __Pyx_RefNannyDeclarations
10276  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10277  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10278 
10279  /* function exit code */
10280  __Pyx_RefNannyFinishContext();
10281  return __pyx_r;
10282 }
10283 
10284 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10285  PyObject *__pyx_v_state = 0;
10286  PyObject *__pyx_v__dict = 0;
10287  int __pyx_v_use_setstate;
10288  PyObject *__pyx_r = NULL;
10289  __Pyx_TraceDeclarations
10290  __Pyx_RefNannyDeclarations
10291  PyObject *__pyx_t_1 = NULL;
10292  int __pyx_t_2;
10293  int __pyx_t_3;
10294  PyObject *__pyx_t_4 = NULL;
10295  PyObject *__pyx_t_5 = NULL;
10296  int __pyx_lineno = 0;
10297  const char *__pyx_filename = NULL;
10298  int __pyx_clineno = 0;
10299  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10300  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10301 
10302  /* "(tree fragment)":5
10303  * cdef object _dict
10304  * cdef bint use_setstate
10305  * state = (self.name,) # <<<<<<<<<<<<<<
10306  * _dict = getattr(self, '__dict__', None)
10307  * if _dict is not None:
10308  */
10309  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10310  __Pyx_GOTREF(__pyx_t_1);
10311  __Pyx_INCREF(__pyx_v_self->name);
10312  __Pyx_GIVEREF(__pyx_v_self->name);
10313  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10314  __pyx_v_state = ((PyObject*)__pyx_t_1);
10315  __pyx_t_1 = 0;
10316 
10317  /* "(tree fragment)":6
10318  * cdef bint use_setstate
10319  * state = (self.name,)
10320  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10321  * if _dict is not None:
10322  * state += (_dict,)
10323  */
10324  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10325  __Pyx_GOTREF(__pyx_t_1);
10326  __pyx_v__dict = __pyx_t_1;
10327  __pyx_t_1 = 0;
10328 
10329  /* "(tree fragment)":7
10330  * state = (self.name,)
10331  * _dict = getattr(self, '__dict__', None)
10332  * if _dict is not None: # <<<<<<<<<<<<<<
10333  * state += (_dict,)
10334  * use_setstate = True
10335  */
10336  __pyx_t_2 = (__pyx_v__dict != Py_None);
10337  __pyx_t_3 = (__pyx_t_2 != 0);
10338  if (__pyx_t_3) {
10339 
10340  /* "(tree fragment)":8
10341  * _dict = getattr(self, '__dict__', None)
10342  * if _dict is not None:
10343  * state += (_dict,) # <<<<<<<<<<<<<<
10344  * use_setstate = True
10345  * else:
10346  */
10347  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10348  __Pyx_GOTREF(__pyx_t_1);
10349  __Pyx_INCREF(__pyx_v__dict);
10350  __Pyx_GIVEREF(__pyx_v__dict);
10351  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10352  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10353  __Pyx_GOTREF(__pyx_t_4);
10354  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10355  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10356  __pyx_t_4 = 0;
10357 
10358  /* "(tree fragment)":9
10359  * if _dict is not None:
10360  * state += (_dict,)
10361  * use_setstate = True # <<<<<<<<<<<<<<
10362  * else:
10363  * use_setstate = self.name is not None
10364  */
10365  __pyx_v_use_setstate = 1;
10366 
10367  /* "(tree fragment)":7
10368  * state = (self.name,)
10369  * _dict = getattr(self, '__dict__', None)
10370  * if _dict is not None: # <<<<<<<<<<<<<<
10371  * state += (_dict,)
10372  * use_setstate = True
10373  */
10374  goto __pyx_L3;
10375  }
10376 
10377  /* "(tree fragment)":11
10378  * use_setstate = True
10379  * else:
10380  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10381  * if use_setstate:
10382  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10383  */
10384  /*else*/ {
10385  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10386  __pyx_v_use_setstate = __pyx_t_3;
10387  }
10388  __pyx_L3:;
10389 
10390  /* "(tree fragment)":12
10391  * else:
10392  * use_setstate = self.name is not None
10393  * if use_setstate: # <<<<<<<<<<<<<<
10394  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10395  * else:
10396  */
10397  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10398  if (__pyx_t_3) {
10399 
10400  /* "(tree fragment)":13
10401  * use_setstate = self.name is not None
10402  * if use_setstate:
10403  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10404  * else:
10405  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10406  */
10407  __Pyx_XDECREF(__pyx_r);
10408  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10409  __Pyx_GOTREF(__pyx_t_4);
10410  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10411  __Pyx_GOTREF(__pyx_t_1);
10412  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10413  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10414  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10415  __Pyx_INCREF(__pyx_int_184977713);
10416  __Pyx_GIVEREF(__pyx_int_184977713);
10417  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10418  __Pyx_INCREF(Py_None);
10419  __Pyx_GIVEREF(Py_None);
10420  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10421  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10422  __Pyx_GOTREF(__pyx_t_5);
10423  __Pyx_GIVEREF(__pyx_t_4);
10424  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10425  __Pyx_GIVEREF(__pyx_t_1);
10426  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10427  __Pyx_INCREF(__pyx_v_state);
10428  __Pyx_GIVEREF(__pyx_v_state);
10429  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10430  __pyx_t_4 = 0;
10431  __pyx_t_1 = 0;
10432  __pyx_r = __pyx_t_5;
10433  __pyx_t_5 = 0;
10434  goto __pyx_L0;
10435 
10436  /* "(tree fragment)":12
10437  * else:
10438  * use_setstate = self.name is not None
10439  * if use_setstate: # <<<<<<<<<<<<<<
10440  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10441  * else:
10442  */
10443  }
10444 
10445  /* "(tree fragment)":15
10446  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10447  * else:
10448  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10449  * def __setstate_cython__(self, __pyx_state):
10450  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10451  */
10452  /*else*/ {
10453  __Pyx_XDECREF(__pyx_r);
10454  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10455  __Pyx_GOTREF(__pyx_t_5);
10456  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10457  __Pyx_GOTREF(__pyx_t_1);
10458  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10459  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10460  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10461  __Pyx_INCREF(__pyx_int_184977713);
10462  __Pyx_GIVEREF(__pyx_int_184977713);
10463  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10464  __Pyx_INCREF(__pyx_v_state);
10465  __Pyx_GIVEREF(__pyx_v_state);
10466  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10467  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10468  __Pyx_GOTREF(__pyx_t_4);
10469  __Pyx_GIVEREF(__pyx_t_5);
10470  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10471  __Pyx_GIVEREF(__pyx_t_1);
10472  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10473  __pyx_t_5 = 0;
10474  __pyx_t_1 = 0;
10475  __pyx_r = __pyx_t_4;
10476  __pyx_t_4 = 0;
10477  goto __pyx_L0;
10478  }
10479 
10480  /* "(tree fragment)":1
10481  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10482  * cdef tuple state
10483  * cdef object _dict
10484  */
10485 
10486  /* function exit code */
10487  __pyx_L1_error:;
10488  __Pyx_XDECREF(__pyx_t_1);
10489  __Pyx_XDECREF(__pyx_t_4);
10490  __Pyx_XDECREF(__pyx_t_5);
10491  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10492  __pyx_r = NULL;
10493  __pyx_L0:;
10494  __Pyx_XDECREF(__pyx_v_state);
10495  __Pyx_XDECREF(__pyx_v__dict);
10496  __Pyx_XGIVEREF(__pyx_r);
10497  __Pyx_TraceReturn(__pyx_r, 0);
10498  __Pyx_RefNannyFinishContext();
10499  return __pyx_r;
10500 }
10501 
10502 /* "(tree fragment)":16
10503  * else:
10504  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10505  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10506  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10507  */
10508 
10509 /* Python wrapper */
10510 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10511 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10512 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10513  PyObject *__pyx_r = 0;
10514  __Pyx_RefNannyDeclarations
10515  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10516  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10517 
10518  /* function exit code */
10519  __Pyx_RefNannyFinishContext();
10520  return __pyx_r;
10521 }
10522 
10523 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10524  PyObject *__pyx_r = NULL;
10525  __Pyx_TraceDeclarations
10526  __Pyx_RefNannyDeclarations
10527  PyObject *__pyx_t_1 = NULL;
10528  int __pyx_lineno = 0;
10529  const char *__pyx_filename = NULL;
10530  int __pyx_clineno = 0;
10531  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10532  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10533 
10534  /* "(tree fragment)":17
10535  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10536  * def __setstate_cython__(self, __pyx_state):
10537  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10538  */
10539  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10540  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10541  __Pyx_GOTREF(__pyx_t_1);
10542  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10543 
10544  /* "(tree fragment)":16
10545  * else:
10546  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10547  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10548  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10549  */
10550 
10551  /* function exit code */
10552  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10553  goto __pyx_L0;
10554  __pyx_L1_error:;
10555  __Pyx_XDECREF(__pyx_t_1);
10556  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10557  __pyx_r = NULL;
10558  __pyx_L0:;
10559  __Pyx_XGIVEREF(__pyx_r);
10560  __Pyx_TraceReturn(__pyx_r, 0);
10561  __Pyx_RefNannyFinishContext();
10562  return __pyx_r;
10563 }
10564 
10565 /* "View.MemoryView":298
10566  *
10567  * @cname('__pyx_align_pointer')
10568  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10569  * "Align pointer memory on a given boundary"
10570  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10571  */
10572 
10573 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10574  Py_intptr_t __pyx_v_aligned_p;
10575  size_t __pyx_v_offset;
10576  void *__pyx_r;
10577  __Pyx_TraceDeclarations
10578  int __pyx_t_1;
10579  int __pyx_lineno = 0;
10580  const char *__pyx_filename = NULL;
10581  int __pyx_clineno = 0;
10582  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10583 
10584  /* "View.MemoryView":300
10585  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10586  * "Align pointer memory on a given boundary"
10587  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10588  * cdef size_t offset
10589  *
10590  */
10591  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10592 
10593  /* "View.MemoryView":304
10594  *
10595  * with cython.cdivision(True):
10596  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10597  *
10598  * if offset > 0:
10599  */
10600  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10601 
10602  /* "View.MemoryView":306
10603  * offset = aligned_p % alignment
10604  *
10605  * if offset > 0: # <<<<<<<<<<<<<<
10606  * aligned_p += alignment - offset
10607  *
10608  */
10609  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10610  if (__pyx_t_1) {
10611 
10612  /* "View.MemoryView":307
10613  *
10614  * if offset > 0:
10615  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10616  *
10617  * return <void *> aligned_p
10618  */
10619  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10620 
10621  /* "View.MemoryView":306
10622  * offset = aligned_p % alignment
10623  *
10624  * if offset > 0: # <<<<<<<<<<<<<<
10625  * aligned_p += alignment - offset
10626  *
10627  */
10628  }
10629 
10630  /* "View.MemoryView":309
10631  * aligned_p += alignment - offset
10632  *
10633  * return <void *> aligned_p # <<<<<<<<<<<<<<
10634  *
10635  *
10636  */
10637  __pyx_r = ((void *)__pyx_v_aligned_p);
10638  goto __pyx_L0;
10639 
10640  /* "View.MemoryView":298
10641  *
10642  * @cname('__pyx_align_pointer')
10643  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10644  * "Align pointer memory on a given boundary"
10645  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10646  */
10647 
10648  /* function exit code */
10649  __pyx_L1_error:;
10650  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10651  __pyx_r = 0;
10652  __pyx_L0:;
10653  __Pyx_TraceReturn(Py_None, 1);
10654  return __pyx_r;
10655 }
10656 
10657 /* "View.MemoryView":345
10658  * cdef __Pyx_TypeInfo *typeinfo
10659  *
10660  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10661  * self.obj = obj
10662  * self.flags = flags
10663  */
10664 
10665 /* Python wrapper */
10666 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10667 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10668  PyObject *__pyx_v_obj = 0;
10669  int __pyx_v_flags;
10670  int __pyx_v_dtype_is_object;
10671  int __pyx_lineno = 0;
10672  const char *__pyx_filename = NULL;
10673  int __pyx_clineno = 0;
10674  int __pyx_r;
10675  __Pyx_RefNannyDeclarations
10676  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10677  {
10678  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10679  PyObject* values[3] = {0,0,0};
10680  if (unlikely(__pyx_kwds)) {
10681  Py_ssize_t kw_args;
10682  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10683  switch (pos_args) {
10684  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10685  CYTHON_FALLTHROUGH;
10686  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10687  CYTHON_FALLTHROUGH;
10688  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10689  CYTHON_FALLTHROUGH;
10690  case 0: break;
10691  default: goto __pyx_L5_argtuple_error;
10692  }
10693  kw_args = PyDict_Size(__pyx_kwds);
10694  switch (pos_args) {
10695  case 0:
10696  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10697  else goto __pyx_L5_argtuple_error;
10698  CYTHON_FALLTHROUGH;
10699  case 1:
10700  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10701  else {
10702  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10703  }
10704  CYTHON_FALLTHROUGH;
10705  case 2:
10706  if (kw_args > 0) {
10707  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10708  if (value) { values[2] = value; kw_args--; }
10709  }
10710  }
10711  if (unlikely(kw_args > 0)) {
10712  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10713  }
10714  } else {
10715  switch (PyTuple_GET_SIZE(__pyx_args)) {
10716  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10717  CYTHON_FALLTHROUGH;
10718  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10719  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10720  break;
10721  default: goto __pyx_L5_argtuple_error;
10722  }
10723  }
10724  __pyx_v_obj = values[0];
10725  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10726  if (values[2]) {
10727  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10728  } else {
10729  __pyx_v_dtype_is_object = ((int)0);
10730  }
10731  }
10732  goto __pyx_L4_argument_unpacking_done;
10733  __pyx_L5_argtuple_error:;
10734  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10735  __pyx_L3_error:;
10736  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10737  __Pyx_RefNannyFinishContext();
10738  return -1;
10739  __pyx_L4_argument_unpacking_done:;
10740  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10741 
10742  /* function exit code */
10743  __Pyx_RefNannyFinishContext();
10744  return __pyx_r;
10745 }
10746 
10747 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10748  int __pyx_r;
10749  __Pyx_TraceDeclarations
10750  __Pyx_RefNannyDeclarations
10751  int __pyx_t_1;
10752  int __pyx_t_2;
10753  int __pyx_t_3;
10754  int __pyx_t_4;
10755  int __pyx_lineno = 0;
10756  const char *__pyx_filename = NULL;
10757  int __pyx_clineno = 0;
10758  __Pyx_RefNannySetupContext("__cinit__", 0);
10759  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10760 
10761  /* "View.MemoryView":346
10762  *
10763  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10764  * self.obj = obj # <<<<<<<<<<<<<<
10765  * self.flags = flags
10766  * if type(self) is memoryview or obj is not None:
10767  */
10768  __Pyx_INCREF(__pyx_v_obj);
10769  __Pyx_GIVEREF(__pyx_v_obj);
10770  __Pyx_GOTREF(__pyx_v_self->obj);
10771  __Pyx_DECREF(__pyx_v_self->obj);
10772  __pyx_v_self->obj = __pyx_v_obj;
10773 
10774  /* "View.MemoryView":347
10775  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10776  * self.obj = obj
10777  * self.flags = flags # <<<<<<<<<<<<<<
10778  * if type(self) is memoryview or obj is not None:
10779  * __Pyx_GetBuffer(obj, &self.view, flags)
10780  */
10781  __pyx_v_self->flags = __pyx_v_flags;
10782 
10783  /* "View.MemoryView":348
10784  * self.obj = obj
10785  * self.flags = flags
10786  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10787  * __Pyx_GetBuffer(obj, &self.view, flags)
10788  * if <PyObject *> self.view.obj == NULL:
10789  */
10790  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10791  __pyx_t_3 = (__pyx_t_2 != 0);
10792  if (!__pyx_t_3) {
10793  } else {
10794  __pyx_t_1 = __pyx_t_3;
10795  goto __pyx_L4_bool_binop_done;
10796  }
10797  __pyx_t_3 = (__pyx_v_obj != Py_None);
10798  __pyx_t_2 = (__pyx_t_3 != 0);
10799  __pyx_t_1 = __pyx_t_2;
10800  __pyx_L4_bool_binop_done:;
10801  if (__pyx_t_1) {
10802 
10803  /* "View.MemoryView":349
10804  * self.flags = flags
10805  * if type(self) is memoryview or obj is not None:
10806  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10807  * if <PyObject *> self.view.obj == NULL:
10808  * (<__pyx_buffer *> &self.view).obj = Py_None
10809  */
10810  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10811 
10812  /* "View.MemoryView":350
10813  * if type(self) is memoryview or obj is not None:
10814  * __Pyx_GetBuffer(obj, &self.view, flags)
10815  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10816  * (<__pyx_buffer *> &self.view).obj = Py_None
10817  * Py_INCREF(Py_None)
10818  */
10819  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10820  if (__pyx_t_1) {
10821 
10822  /* "View.MemoryView":351
10823  * __Pyx_GetBuffer(obj, &self.view, flags)
10824  * if <PyObject *> self.view.obj == NULL:
10825  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10826  * Py_INCREF(Py_None)
10827  *
10828  */
10829  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10830 
10831  /* "View.MemoryView":352
10832  * if <PyObject *> self.view.obj == NULL:
10833  * (<__pyx_buffer *> &self.view).obj = Py_None
10834  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10835  *
10836  * global __pyx_memoryview_thread_locks_used
10837  */
10838  Py_INCREF(Py_None);
10839 
10840  /* "View.MemoryView":350
10841  * if type(self) is memoryview or obj is not None:
10842  * __Pyx_GetBuffer(obj, &self.view, flags)
10843  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10844  * (<__pyx_buffer *> &self.view).obj = Py_None
10845  * Py_INCREF(Py_None)
10846  */
10847  }
10848 
10849  /* "View.MemoryView":348
10850  * self.obj = obj
10851  * self.flags = flags
10852  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10853  * __Pyx_GetBuffer(obj, &self.view, flags)
10854  * if <PyObject *> self.view.obj == NULL:
10855  */
10856  }
10857 
10858  /* "View.MemoryView":355
10859  *
10860  * global __pyx_memoryview_thread_locks_used
10861  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10862  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10863  * __pyx_memoryview_thread_locks_used += 1
10864  */
10865  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10866  if (__pyx_t_1) {
10867 
10868  /* "View.MemoryView":356
10869  * global __pyx_memoryview_thread_locks_used
10870  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10871  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10872  * __pyx_memoryview_thread_locks_used += 1
10873  * if self.lock is NULL:
10874  */
10875  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10876 
10877  /* "View.MemoryView":357
10878  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10879  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10880  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10881  * if self.lock is NULL:
10882  * self.lock = PyThread_allocate_lock()
10883  */
10884  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10885 
10886  /* "View.MemoryView":355
10887  *
10888  * global __pyx_memoryview_thread_locks_used
10889  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10890  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10891  * __pyx_memoryview_thread_locks_used += 1
10892  */
10893  }
10894 
10895  /* "View.MemoryView":358
10896  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10897  * __pyx_memoryview_thread_locks_used += 1
10898  * if self.lock is NULL: # <<<<<<<<<<<<<<
10899  * self.lock = PyThread_allocate_lock()
10900  * if self.lock is NULL:
10901  */
10902  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10903  if (__pyx_t_1) {
10904 
10905  /* "View.MemoryView":359
10906  * __pyx_memoryview_thread_locks_used += 1
10907  * if self.lock is NULL:
10908  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10909  * if self.lock is NULL:
10910  * raise MemoryError
10911  */
10912  __pyx_v_self->lock = PyThread_allocate_lock();
10913 
10914  /* "View.MemoryView":360
10915  * if self.lock is NULL:
10916  * self.lock = PyThread_allocate_lock()
10917  * if self.lock is NULL: # <<<<<<<<<<<<<<
10918  * raise MemoryError
10919  *
10920  */
10921  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10922  if (unlikely(__pyx_t_1)) {
10923 
10924  /* "View.MemoryView":361
10925  * self.lock = PyThread_allocate_lock()
10926  * if self.lock is NULL:
10927  * raise MemoryError # <<<<<<<<<<<<<<
10928  *
10929  * if flags & PyBUF_FORMAT:
10930  */
10931  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10932 
10933  /* "View.MemoryView":360
10934  * if self.lock is NULL:
10935  * self.lock = PyThread_allocate_lock()
10936  * if self.lock is NULL: # <<<<<<<<<<<<<<
10937  * raise MemoryError
10938  *
10939  */
10940  }
10941 
10942  /* "View.MemoryView":358
10943  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10944  * __pyx_memoryview_thread_locks_used += 1
10945  * if self.lock is NULL: # <<<<<<<<<<<<<<
10946  * self.lock = PyThread_allocate_lock()
10947  * if self.lock is NULL:
10948  */
10949  }
10950 
10951  /* "View.MemoryView":363
10952  * raise MemoryError
10953  *
10954  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10955  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10956  * else:
10957  */
10958  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10959  if (__pyx_t_1) {
10960 
10961  /* "View.MemoryView":364
10962  *
10963  * if flags & PyBUF_FORMAT:
10964  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10965  * else:
10966  * self.dtype_is_object = dtype_is_object
10967  */
10968  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10969  if (__pyx_t_2) {
10970  } else {
10971  __pyx_t_1 = __pyx_t_2;
10972  goto __pyx_L11_bool_binop_done;
10973  }
10974  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10975  __pyx_t_1 = __pyx_t_2;
10976  __pyx_L11_bool_binop_done:;
10977  __pyx_v_self->dtype_is_object = __pyx_t_1;
10978 
10979  /* "View.MemoryView":363
10980  * raise MemoryError
10981  *
10982  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10983  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10984  * else:
10985  */
10986  goto __pyx_L10;
10987  }
10988 
10989  /* "View.MemoryView":366
10990  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10991  * else:
10992  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10993  *
10994  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10995  */
10996  /*else*/ {
10997  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10998  }
10999  __pyx_L10:;
11000 
11001  /* "View.MemoryView":368
11002  * self.dtype_is_object = dtype_is_object
11003  *
11004  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11005  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11006  * self.typeinfo = NULL
11007  */
11008  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11009 
11010  /* "View.MemoryView":370
11011  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11012  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11013  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11014  *
11015  * def __dealloc__(memoryview self):
11016  */
11017  __pyx_v_self->typeinfo = NULL;
11018 
11019  /* "View.MemoryView":345
11020  * cdef __Pyx_TypeInfo *typeinfo
11021  *
11022  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11023  * self.obj = obj
11024  * self.flags = flags
11025  */
11026 
11027  /* function exit code */
11028  __pyx_r = 0;
11029  goto __pyx_L0;
11030  __pyx_L1_error:;
11031  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11032  __pyx_r = -1;
11033  __pyx_L0:;
11034  __Pyx_TraceReturn(Py_None, 0);
11035  __Pyx_RefNannyFinishContext();
11036  return __pyx_r;
11037 }
11038 
11039 /* "View.MemoryView":372
11040  * self.typeinfo = NULL
11041  *
11042  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11043  * if self.obj is not None:
11044  * __Pyx_ReleaseBuffer(&self.view)
11045  */
11046 
11047 /* Python wrapper */
11048 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11049 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11050  __Pyx_RefNannyDeclarations
11051  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11052  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11053 
11054  /* function exit code */
11055  __Pyx_RefNannyFinishContext();
11056 }
11057 
11058 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11059  int __pyx_v_i;
11060  __Pyx_TraceDeclarations
11061  __Pyx_RefNannyDeclarations
11062  int __pyx_t_1;
11063  int __pyx_t_2;
11064  int __pyx_t_3;
11065  int __pyx_t_4;
11066  int __pyx_t_5;
11067  PyThread_type_lock __pyx_t_6;
11068  PyThread_type_lock __pyx_t_7;
11069  int __pyx_lineno = 0;
11070  const char *__pyx_filename = NULL;
11071  int __pyx_clineno = 0;
11072  __Pyx_RefNannySetupContext("__dealloc__", 0);
11073  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
11074 
11075  /* "View.MemoryView":373
11076  *
11077  * def __dealloc__(memoryview self):
11078  * if self.obj is not None: # <<<<<<<<<<<<<<
11079  * __Pyx_ReleaseBuffer(&self.view)
11080  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11081  */
11082  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11083  __pyx_t_2 = (__pyx_t_1 != 0);
11084  if (__pyx_t_2) {
11085 
11086  /* "View.MemoryView":374
11087  * def __dealloc__(memoryview self):
11088  * if self.obj is not None:
11089  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11090  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11091  *
11092  */
11093  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11094 
11095  /* "View.MemoryView":373
11096  *
11097  * def __dealloc__(memoryview self):
11098  * if self.obj is not None: # <<<<<<<<<<<<<<
11099  * __Pyx_ReleaseBuffer(&self.view)
11100  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11101  */
11102  goto __pyx_L3;
11103  }
11104 
11105  /* "View.MemoryView":375
11106  * if self.obj is not None:
11107  * __Pyx_ReleaseBuffer(&self.view)
11108  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11109  *
11110  * (<__pyx_buffer *> &self.view).obj = NULL
11111  */
11112  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11113  if (__pyx_t_2) {
11114 
11115  /* "View.MemoryView":377
11116  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11117  *
11118  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11119  * Py_DECREF(Py_None)
11120  *
11121  */
11122  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11123 
11124  /* "View.MemoryView":378
11125  *
11126  * (<__pyx_buffer *> &self.view).obj = NULL
11127  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11128  *
11129  * cdef int i
11130  */
11131  Py_DECREF(Py_None);
11132 
11133  /* "View.MemoryView":375
11134  * if self.obj is not None:
11135  * __Pyx_ReleaseBuffer(&self.view)
11136  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11137  *
11138  * (<__pyx_buffer *> &self.view).obj = NULL
11139  */
11140  }
11141  __pyx_L3:;
11142 
11143  /* "View.MemoryView":382
11144  * cdef int i
11145  * global __pyx_memoryview_thread_locks_used
11146  * if self.lock != NULL: # <<<<<<<<<<<<<<
11147  * for i in range(__pyx_memoryview_thread_locks_used):
11148  * if __pyx_memoryview_thread_locks[i] is self.lock:
11149  */
11150  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11151  if (__pyx_t_2) {
11152 
11153  /* "View.MemoryView":383
11154  * global __pyx_memoryview_thread_locks_used
11155  * if self.lock != NULL:
11156  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11157  * if __pyx_memoryview_thread_locks[i] is self.lock:
11158  * __pyx_memoryview_thread_locks_used -= 1
11159  */
11160  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11161  __pyx_t_4 = __pyx_t_3;
11162  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11163  __pyx_v_i = __pyx_t_5;
11164 
11165  /* "View.MemoryView":384
11166  * if self.lock != NULL:
11167  * for i in range(__pyx_memoryview_thread_locks_used):
11168  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11169  * __pyx_memoryview_thread_locks_used -= 1
11170  * if i != __pyx_memoryview_thread_locks_used:
11171  */
11172  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11173  if (__pyx_t_2) {
11174 
11175  /* "View.MemoryView":385
11176  * for i in range(__pyx_memoryview_thread_locks_used):
11177  * if __pyx_memoryview_thread_locks[i] is self.lock:
11178  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11179  * if i != __pyx_memoryview_thread_locks_used:
11180  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11181  */
11182  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11183 
11184  /* "View.MemoryView":386
11185  * if __pyx_memoryview_thread_locks[i] is self.lock:
11186  * __pyx_memoryview_thread_locks_used -= 1
11187  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11188  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11189  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11190  */
11191  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11192  if (__pyx_t_2) {
11193 
11194  /* "View.MemoryView":388
11195  * if i != __pyx_memoryview_thread_locks_used:
11196  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11197  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11198  * break
11199  * else:
11200  */
11201  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11202  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11203 
11204  /* "View.MemoryView":387
11205  * __pyx_memoryview_thread_locks_used -= 1
11206  * if i != __pyx_memoryview_thread_locks_used:
11207  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11208  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11209  * break
11210  */
11211  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11212  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11213 
11214  /* "View.MemoryView":386
11215  * if __pyx_memoryview_thread_locks[i] is self.lock:
11216  * __pyx_memoryview_thread_locks_used -= 1
11217  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11218  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11219  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11220  */
11221  }
11222 
11223  /* "View.MemoryView":389
11224  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11225  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11226  * break # <<<<<<<<<<<<<<
11227  * else:
11228  * PyThread_free_lock(self.lock)
11229  */
11230  goto __pyx_L6_break;
11231 
11232  /* "View.MemoryView":384
11233  * if self.lock != NULL:
11234  * for i in range(__pyx_memoryview_thread_locks_used):
11235  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11236  * __pyx_memoryview_thread_locks_used -= 1
11237  * if i != __pyx_memoryview_thread_locks_used:
11238  */
11239  }
11240  }
11241  /*else*/ {
11242 
11243  /* "View.MemoryView":391
11244  * break
11245  * else:
11246  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11247  *
11248  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11249  */
11250  PyThread_free_lock(__pyx_v_self->lock);
11251  }
11252  __pyx_L6_break:;
11253 
11254  /* "View.MemoryView":382
11255  * cdef int i
11256  * global __pyx_memoryview_thread_locks_used
11257  * if self.lock != NULL: # <<<<<<<<<<<<<<
11258  * for i in range(__pyx_memoryview_thread_locks_used):
11259  * if __pyx_memoryview_thread_locks[i] is self.lock:
11260  */
11261  }
11262 
11263  /* "View.MemoryView":372
11264  * self.typeinfo = NULL
11265  *
11266  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11267  * if self.obj is not None:
11268  * __Pyx_ReleaseBuffer(&self.view)
11269  */
11270 
11271  /* function exit code */
11272  goto __pyx_L0;
11273  __pyx_L1_error:;
11274  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11275  __pyx_L0:;
11276  __Pyx_TraceReturn(Py_None, 0);
11277  __Pyx_RefNannyFinishContext();
11278 }
11279 
11280 /* "View.MemoryView":393
11281  * PyThread_free_lock(self.lock)
11282  *
11283  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11284  * cdef Py_ssize_t dim
11285  * cdef char *itemp = <char *> self.view.buf
11286  */
11287 
11288 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11289  Py_ssize_t __pyx_v_dim;
11290  char *__pyx_v_itemp;
11291  PyObject *__pyx_v_idx = NULL;
11292  char *__pyx_r;
11293  __Pyx_TraceDeclarations
11294  __Pyx_RefNannyDeclarations
11295  Py_ssize_t __pyx_t_1;
11296  PyObject *__pyx_t_2 = NULL;
11297  Py_ssize_t __pyx_t_3;
11298  PyObject *(*__pyx_t_4)(PyObject *);
11299  PyObject *__pyx_t_5 = NULL;
11300  Py_ssize_t __pyx_t_6;
11301  char *__pyx_t_7;
11302  int __pyx_lineno = 0;
11303  const char *__pyx_filename = NULL;
11304  int __pyx_clineno = 0;
11305  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11306  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
11307 
11308  /* "View.MemoryView":395
11309  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11310  * cdef Py_ssize_t dim
11311  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11312  *
11313  * for dim, idx in enumerate(index):
11314  */
11315  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11316 
11317  /* "View.MemoryView":397
11318  * cdef char *itemp = <char *> self.view.buf
11319  *
11320  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11321  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11322  *
11323  */
11324  __pyx_t_1 = 0;
11325  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11326  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11327  __pyx_t_4 = NULL;
11328  } else {
11329  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11330  __Pyx_GOTREF(__pyx_t_2);
11331  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11332  }
11333  for (;;) {
11334  if (likely(!__pyx_t_4)) {
11335  if (likely(PyList_CheckExact(__pyx_t_2))) {
11336  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11337  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11338  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11339  #else
11340  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11341  __Pyx_GOTREF(__pyx_t_5);
11342  #endif
11343  } else {
11344  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11345  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11346  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11347  #else
11348  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11349  __Pyx_GOTREF(__pyx_t_5);
11350  #endif
11351  }
11352  } else {
11353  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11354  if (unlikely(!__pyx_t_5)) {
11355  PyObject* exc_type = PyErr_Occurred();
11356  if (exc_type) {
11357  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11358  else __PYX_ERR(1, 397, __pyx_L1_error)
11359  }
11360  break;
11361  }
11362  __Pyx_GOTREF(__pyx_t_5);
11363  }
11364  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11365  __pyx_t_5 = 0;
11366  __pyx_v_dim = __pyx_t_1;
11367  __pyx_t_1 = (__pyx_t_1 + 1);
11368 
11369  /* "View.MemoryView":398
11370  *
11371  * for dim, idx in enumerate(index):
11372  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11373  *
11374  * return itemp
11375  */
11376  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11377  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11378  __pyx_v_itemp = __pyx_t_7;
11379 
11380  /* "View.MemoryView":397
11381  * cdef char *itemp = <char *> self.view.buf
11382  *
11383  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11384  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11385  *
11386  */
11387  }
11388  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11389 
11390  /* "View.MemoryView":400
11391  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11392  *
11393  * return itemp # <<<<<<<<<<<<<<
11394  *
11395  *
11396  */
11397  __pyx_r = __pyx_v_itemp;
11398  goto __pyx_L0;
11399 
11400  /* "View.MemoryView":393
11401  * PyThread_free_lock(self.lock)
11402  *
11403  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11404  * cdef Py_ssize_t dim
11405  * cdef char *itemp = <char *> self.view.buf
11406  */
11407 
11408  /* function exit code */
11409  __pyx_L1_error:;
11410  __Pyx_XDECREF(__pyx_t_2);
11411  __Pyx_XDECREF(__pyx_t_5);
11412  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11413  __pyx_r = NULL;
11414  __pyx_L0:;
11415  __Pyx_XDECREF(__pyx_v_idx);
11416  __Pyx_TraceReturn(Py_None, 0);
11417  __Pyx_RefNannyFinishContext();
11418  return __pyx_r;
11419 }
11420 
11421 /* "View.MemoryView":403
11422  *
11423  *
11424  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11425  * if index is Ellipsis:
11426  * return self
11427  */
11428 
11429 /* Python wrapper */
11430 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11431 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11432  PyObject *__pyx_r = 0;
11433  __Pyx_RefNannyDeclarations
11434  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11435  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11436 
11437  /* function exit code */
11438  __Pyx_RefNannyFinishContext();
11439  return __pyx_r;
11440 }
11441 
11442 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11443  PyObject *__pyx_v_have_slices = NULL;
11444  PyObject *__pyx_v_indices = NULL;
11445  char *__pyx_v_itemp;
11446  PyObject *__pyx_r = NULL;
11447  __Pyx_TraceDeclarations
11448  __Pyx_RefNannyDeclarations
11449  int __pyx_t_1;
11450  int __pyx_t_2;
11451  PyObject *__pyx_t_3 = NULL;
11452  PyObject *__pyx_t_4 = NULL;
11453  PyObject *__pyx_t_5 = NULL;
11454  char *__pyx_t_6;
11455  int __pyx_lineno = 0;
11456  const char *__pyx_filename = NULL;
11457  int __pyx_clineno = 0;
11458  __Pyx_RefNannySetupContext("__getitem__", 0);
11459  __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
11460 
11461  /* "View.MemoryView":404
11462  *
11463  * def __getitem__(memoryview self, object index):
11464  * if index is Ellipsis: # <<<<<<<<<<<<<<
11465  * return self
11466  *
11467  */
11468  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11469  __pyx_t_2 = (__pyx_t_1 != 0);
11470  if (__pyx_t_2) {
11471 
11472  /* "View.MemoryView":405
11473  * def __getitem__(memoryview self, object index):
11474  * if index is Ellipsis:
11475  * return self # <<<<<<<<<<<<<<
11476  *
11477  * have_slices, indices = _unellipsify(index, self.view.ndim)
11478  */
11479  __Pyx_XDECREF(__pyx_r);
11480  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11481  __pyx_r = ((PyObject *)__pyx_v_self);
11482  goto __pyx_L0;
11483 
11484  /* "View.MemoryView":404
11485  *
11486  * def __getitem__(memoryview self, object index):
11487  * if index is Ellipsis: # <<<<<<<<<<<<<<
11488  * return self
11489  *
11490  */
11491  }
11492 
11493  /* "View.MemoryView":407
11494  * return self
11495  *
11496  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11497  *
11498  * cdef char *itemp
11499  */
11500  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11501  __Pyx_GOTREF(__pyx_t_3);
11502  if (likely(__pyx_t_3 != Py_None)) {
11503  PyObject* sequence = __pyx_t_3;
11504  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11505  if (unlikely(size != 2)) {
11506  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11507  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11508  __PYX_ERR(1, 407, __pyx_L1_error)
11509  }
11510  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11511  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11512  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11513  __Pyx_INCREF(__pyx_t_4);
11514  __Pyx_INCREF(__pyx_t_5);
11515  #else
11516  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11517  __Pyx_GOTREF(__pyx_t_4);
11518  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11519  __Pyx_GOTREF(__pyx_t_5);
11520  #endif
11521  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11522  } else {
11523  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11524  }
11525  __pyx_v_have_slices = __pyx_t_4;
11526  __pyx_t_4 = 0;
11527  __pyx_v_indices = __pyx_t_5;
11528  __pyx_t_5 = 0;
11529 
11530  /* "View.MemoryView":410
11531  *
11532  * cdef char *itemp
11533  * if have_slices: # <<<<<<<<<<<<<<
11534  * return memview_slice(self, indices)
11535  * else:
11536  */
11537  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11538  if (__pyx_t_2) {
11539 
11540  /* "View.MemoryView":411
11541  * cdef char *itemp
11542  * if have_slices:
11543  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11544  * else:
11545  * itemp = self.get_item_pointer(indices)
11546  */
11547  __Pyx_XDECREF(__pyx_r);
11548  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11549  __Pyx_GOTREF(__pyx_t_3);
11550  __pyx_r = __pyx_t_3;
11551  __pyx_t_3 = 0;
11552  goto __pyx_L0;
11553 
11554  /* "View.MemoryView":410
11555  *
11556  * cdef char *itemp
11557  * if have_slices: # <<<<<<<<<<<<<<
11558  * return memview_slice(self, indices)
11559  * else:
11560  */
11561  }
11562 
11563  /* "View.MemoryView":413
11564  * return memview_slice(self, indices)
11565  * else:
11566  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11567  * return self.convert_item_to_object(itemp)
11568  *
11569  */
11570  /*else*/ {
11571  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11572  __pyx_v_itemp = __pyx_t_6;
11573 
11574  /* "View.MemoryView":414
11575  * else:
11576  * itemp = self.get_item_pointer(indices)
11577  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11578  *
11579  * def __setitem__(memoryview self, object index, object value):
11580  */
11581  __Pyx_XDECREF(__pyx_r);
11582  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11583  __Pyx_GOTREF(__pyx_t_3);
11584  __pyx_r = __pyx_t_3;
11585  __pyx_t_3 = 0;
11586  goto __pyx_L0;
11587  }
11588 
11589  /* "View.MemoryView":403
11590  *
11591  *
11592  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11593  * if index is Ellipsis:
11594  * return self
11595  */
11596 
11597  /* function exit code */
11598  __pyx_L1_error:;
11599  __Pyx_XDECREF(__pyx_t_3);
11600  __Pyx_XDECREF(__pyx_t_4);
11601  __Pyx_XDECREF(__pyx_t_5);
11602  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11603  __pyx_r = NULL;
11604  __pyx_L0:;
11605  __Pyx_XDECREF(__pyx_v_have_slices);
11606  __Pyx_XDECREF(__pyx_v_indices);
11607  __Pyx_XGIVEREF(__pyx_r);
11608  __Pyx_TraceReturn(__pyx_r, 0);
11609  __Pyx_RefNannyFinishContext();
11610  return __pyx_r;
11611 }
11612 
11613 /* "View.MemoryView":416
11614  * return self.convert_item_to_object(itemp)
11615  *
11616  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11617  * if self.view.readonly:
11618  * raise TypeError("Cannot assign to read-only memoryview")
11619  */
11620 
11621 /* Python wrapper */
11622 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11623 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11624  int __pyx_r;
11625  __Pyx_RefNannyDeclarations
11626  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11627  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11628 
11629  /* function exit code */
11630  __Pyx_RefNannyFinishContext();
11631  return __pyx_r;
11632 }
11633 
11634 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11635  PyObject *__pyx_v_have_slices = NULL;
11636  PyObject *__pyx_v_obj = NULL;
11637  int __pyx_r;
11638  __Pyx_TraceDeclarations
11639  __Pyx_RefNannyDeclarations
11640  int __pyx_t_1;
11641  PyObject *__pyx_t_2 = NULL;
11642  PyObject *__pyx_t_3 = NULL;
11643  PyObject *__pyx_t_4 = NULL;
11644  int __pyx_lineno = 0;
11645  const char *__pyx_filename = NULL;
11646  int __pyx_clineno = 0;
11647  __Pyx_RefNannySetupContext("__setitem__", 0);
11648  __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11649  __Pyx_INCREF(__pyx_v_index);
11650 
11651  /* "View.MemoryView":417
11652  *
11653  * def __setitem__(memoryview self, object index, object value):
11654  * if self.view.readonly: # <<<<<<<<<<<<<<
11655  * raise TypeError("Cannot assign to read-only memoryview")
11656  *
11657  */
11658  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11659  if (unlikely(__pyx_t_1)) {
11660 
11661  /* "View.MemoryView":418
11662  * def __setitem__(memoryview self, object index, object value):
11663  * if self.view.readonly:
11664  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11665  *
11666  * have_slices, index = _unellipsify(index, self.view.ndim)
11667  */
11668  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11669  __Pyx_GOTREF(__pyx_t_2);
11670  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11671  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11672  __PYX_ERR(1, 418, __pyx_L1_error)
11673 
11674  /* "View.MemoryView":417
11675  *
11676  * def __setitem__(memoryview self, object index, object value):
11677  * if self.view.readonly: # <<<<<<<<<<<<<<
11678  * raise TypeError("Cannot assign to read-only memoryview")
11679  *
11680  */
11681  }
11682 
11683  /* "View.MemoryView":420
11684  * raise TypeError("Cannot assign to read-only memoryview")
11685  *
11686  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11687  *
11688  * if have_slices:
11689  */
11690  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11691  __Pyx_GOTREF(__pyx_t_2);
11692  if (likely(__pyx_t_2 != Py_None)) {
11693  PyObject* sequence = __pyx_t_2;
11694  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11695  if (unlikely(size != 2)) {
11696  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11697  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11698  __PYX_ERR(1, 420, __pyx_L1_error)
11699  }
11700  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11701  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11702  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11703  __Pyx_INCREF(__pyx_t_3);
11704  __Pyx_INCREF(__pyx_t_4);
11705  #else
11706  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11707  __Pyx_GOTREF(__pyx_t_3);
11708  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11709  __Pyx_GOTREF(__pyx_t_4);
11710  #endif
11711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11712  } else {
11713  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11714  }
11715  __pyx_v_have_slices = __pyx_t_3;
11716  __pyx_t_3 = 0;
11717  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11718  __pyx_t_4 = 0;
11719 
11720  /* "View.MemoryView":422
11721  * have_slices, index = _unellipsify(index, self.view.ndim)
11722  *
11723  * if have_slices: # <<<<<<<<<<<<<<
11724  * obj = self.is_slice(value)
11725  * if obj:
11726  */
11727  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11728  if (__pyx_t_1) {
11729 
11730  /* "View.MemoryView":423
11731  *
11732  * if have_slices:
11733  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11734  * if obj:
11735  * self.setitem_slice_assignment(self[index], obj)
11736  */
11737  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11738  __Pyx_GOTREF(__pyx_t_2);
11739  __pyx_v_obj = __pyx_t_2;
11740  __pyx_t_2 = 0;
11741 
11742  /* "View.MemoryView":424
11743  * if have_slices:
11744  * obj = self.is_slice(value)
11745  * if obj: # <<<<<<<<<<<<<<
11746  * self.setitem_slice_assignment(self[index], obj)
11747  * else:
11748  */
11749  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11750  if (__pyx_t_1) {
11751 
11752  /* "View.MemoryView":425
11753  * obj = self.is_slice(value)
11754  * if obj:
11755  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11756  * else:
11757  * self.setitem_slice_assign_scalar(self[index], value)
11758  */
11759  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11760  __Pyx_GOTREF(__pyx_t_2);
11761  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11762  __Pyx_GOTREF(__pyx_t_4);
11763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11764  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11765 
11766  /* "View.MemoryView":424
11767  * if have_slices:
11768  * obj = self.is_slice(value)
11769  * if obj: # <<<<<<<<<<<<<<
11770  * self.setitem_slice_assignment(self[index], obj)
11771  * else:
11772  */
11773  goto __pyx_L5;
11774  }
11775 
11776  /* "View.MemoryView":427
11777  * self.setitem_slice_assignment(self[index], obj)
11778  * else:
11779  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11780  * else:
11781  * self.setitem_indexed(index, value)
11782  */
11783  /*else*/ {
11784  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11785  __Pyx_GOTREF(__pyx_t_4);
11786  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11787  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11788  __Pyx_GOTREF(__pyx_t_2);
11789  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11790  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11791  }
11792  __pyx_L5:;
11793 
11794  /* "View.MemoryView":422
11795  * have_slices, index = _unellipsify(index, self.view.ndim)
11796  *
11797  * if have_slices: # <<<<<<<<<<<<<<
11798  * obj = self.is_slice(value)
11799  * if obj:
11800  */
11801  goto __pyx_L4;
11802  }
11803 
11804  /* "View.MemoryView":429
11805  * self.setitem_slice_assign_scalar(self[index], value)
11806  * else:
11807  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11808  *
11809  * cdef is_slice(self, obj):
11810  */
11811  /*else*/ {
11812  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11813  __Pyx_GOTREF(__pyx_t_2);
11814  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11815  }
11816  __pyx_L4:;
11817 
11818  /* "View.MemoryView":416
11819  * return self.convert_item_to_object(itemp)
11820  *
11821  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11822  * if self.view.readonly:
11823  * raise TypeError("Cannot assign to read-only memoryview")
11824  */
11825 
11826  /* function exit code */
11827  __pyx_r = 0;
11828  goto __pyx_L0;
11829  __pyx_L1_error:;
11830  __Pyx_XDECREF(__pyx_t_2);
11831  __Pyx_XDECREF(__pyx_t_3);
11832  __Pyx_XDECREF(__pyx_t_4);
11833  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11834  __pyx_r = -1;
11835  __pyx_L0:;
11836  __Pyx_XDECREF(__pyx_v_have_slices);
11837  __Pyx_XDECREF(__pyx_v_obj);
11838  __Pyx_XDECREF(__pyx_v_index);
11839  __Pyx_TraceReturn(Py_None, 0);
11840  __Pyx_RefNannyFinishContext();
11841  return __pyx_r;
11842 }
11843 
11844 /* "View.MemoryView":431
11845  * self.setitem_indexed(index, value)
11846  *
11847  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11848  * if not isinstance(obj, memoryview):
11849  * try:
11850  */
11851 
11852 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11853  PyObject *__pyx_r = NULL;
11854  __Pyx_TraceDeclarations
11855  __Pyx_RefNannyDeclarations
11856  int __pyx_t_1;
11857  int __pyx_t_2;
11858  PyObject *__pyx_t_3 = NULL;
11859  PyObject *__pyx_t_4 = NULL;
11860  PyObject *__pyx_t_5 = NULL;
11861  PyObject *__pyx_t_6 = NULL;
11862  PyObject *__pyx_t_7 = NULL;
11863  PyObject *__pyx_t_8 = NULL;
11864  int __pyx_t_9;
11865  int __pyx_lineno = 0;
11866  const char *__pyx_filename = NULL;
11867  int __pyx_clineno = 0;
11868  __Pyx_RefNannySetupContext("is_slice", 0);
11869  __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11870  __Pyx_INCREF(__pyx_v_obj);
11871 
11872  /* "View.MemoryView":432
11873  *
11874  * cdef is_slice(self, obj):
11875  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11876  * try:
11877  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11878  */
11879  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11880  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11881  if (__pyx_t_2) {
11882 
11883  /* "View.MemoryView":433
11884  * cdef is_slice(self, obj):
11885  * if not isinstance(obj, memoryview):
11886  * try: # <<<<<<<<<<<<<<
11887  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11888  * self.dtype_is_object)
11889  */
11890  {
11891  __Pyx_PyThreadState_declare
11892  __Pyx_PyThreadState_assign
11893  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11894  __Pyx_XGOTREF(__pyx_t_3);
11895  __Pyx_XGOTREF(__pyx_t_4);
11896  __Pyx_XGOTREF(__pyx_t_5);
11897  /*try:*/ {
11898 
11899  /* "View.MemoryView":434
11900  * if not isinstance(obj, memoryview):
11901  * try:
11902  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11903  * self.dtype_is_object)
11904  * except TypeError:
11905  */
11906  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11907  __Pyx_GOTREF(__pyx_t_6);
11908 
11909  /* "View.MemoryView":435
11910  * try:
11911  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11912  * self.dtype_is_object) # <<<<<<<<<<<<<<
11913  * except TypeError:
11914  * return None
11915  */
11916  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11917  __Pyx_GOTREF(__pyx_t_7);
11918 
11919  /* "View.MemoryView":434
11920  * if not isinstance(obj, memoryview):
11921  * try:
11922  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11923  * self.dtype_is_object)
11924  * except TypeError:
11925  */
11926  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11927  __Pyx_GOTREF(__pyx_t_8);
11928  __Pyx_INCREF(__pyx_v_obj);
11929  __Pyx_GIVEREF(__pyx_v_obj);
11930  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11931  __Pyx_GIVEREF(__pyx_t_6);
11932  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11933  __Pyx_GIVEREF(__pyx_t_7);
11934  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11935  __pyx_t_6 = 0;
11936  __pyx_t_7 = 0;
11937  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11938  __Pyx_GOTREF(__pyx_t_7);
11939  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11940  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11941  __pyx_t_7 = 0;
11942 
11943  /* "View.MemoryView":433
11944  * cdef is_slice(self, obj):
11945  * if not isinstance(obj, memoryview):
11946  * try: # <<<<<<<<<<<<<<
11947  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11948  * self.dtype_is_object)
11949  */
11950  }
11951  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11952  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11953  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11954  goto __pyx_L9_try_end;
11955  __pyx_L4_error:;
11956  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11957  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11958  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11959 
11960  /* "View.MemoryView":436
11961  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11962  * self.dtype_is_object)
11963  * except TypeError: # <<<<<<<<<<<<<<
11964  * return None
11965  *
11966  */
11967  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11968  if (__pyx_t_9) {
11969  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11970  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11971  __Pyx_GOTREF(__pyx_t_7);
11972  __Pyx_GOTREF(__pyx_t_8);
11973  __Pyx_GOTREF(__pyx_t_6);
11974 
11975  /* "View.MemoryView":437
11976  * self.dtype_is_object)
11977  * except TypeError:
11978  * return None # <<<<<<<<<<<<<<
11979  *
11980  * return obj
11981  */
11982  __Pyx_XDECREF(__pyx_r);
11983  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11984  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11985  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11986  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11987  goto __pyx_L7_except_return;
11988  }
11989  goto __pyx_L6_except_error;
11990  __pyx_L6_except_error:;
11991 
11992  /* "View.MemoryView":433
11993  * cdef is_slice(self, obj):
11994  * if not isinstance(obj, memoryview):
11995  * try: # <<<<<<<<<<<<<<
11996  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11997  * self.dtype_is_object)
11998  */
11999  __Pyx_XGIVEREF(__pyx_t_3);
12000  __Pyx_XGIVEREF(__pyx_t_4);
12001  __Pyx_XGIVEREF(__pyx_t_5);
12002  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12003  goto __pyx_L1_error;
12004  __pyx_L7_except_return:;
12005  __Pyx_XGIVEREF(__pyx_t_3);
12006  __Pyx_XGIVEREF(__pyx_t_4);
12007  __Pyx_XGIVEREF(__pyx_t_5);
12008  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12009  goto __pyx_L0;
12010  __pyx_L9_try_end:;
12011  }
12012 
12013  /* "View.MemoryView":432
12014  *
12015  * cdef is_slice(self, obj):
12016  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12017  * try:
12018  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12019  */
12020  }
12021 
12022  /* "View.MemoryView":439
12023  * return None
12024  *
12025  * return obj # <<<<<<<<<<<<<<
12026  *
12027  * cdef setitem_slice_assignment(self, dst, src):
12028  */
12029  __Pyx_XDECREF(__pyx_r);
12030  __Pyx_INCREF(__pyx_v_obj);
12031  __pyx_r = __pyx_v_obj;
12032  goto __pyx_L0;
12033 
12034  /* "View.MemoryView":431
12035  * self.setitem_indexed(index, value)
12036  *
12037  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12038  * if not isinstance(obj, memoryview):
12039  * try:
12040  */
12041 
12042  /* function exit code */
12043  __pyx_L1_error:;
12044  __Pyx_XDECREF(__pyx_t_6);
12045  __Pyx_XDECREF(__pyx_t_7);
12046  __Pyx_XDECREF(__pyx_t_8);
12047  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12048  __pyx_r = 0;
12049  __pyx_L0:;
12050  __Pyx_XDECREF(__pyx_v_obj);
12051  __Pyx_XGIVEREF(__pyx_r);
12052  __Pyx_TraceReturn(__pyx_r, 0);
12053  __Pyx_RefNannyFinishContext();
12054  return __pyx_r;
12055 }
12056 
12057 /* "View.MemoryView":441
12058  * return obj
12059  *
12060  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12061  * cdef __Pyx_memviewslice dst_slice
12062  * cdef __Pyx_memviewslice src_slice
12063  */
12064 
12065 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12066  __Pyx_memviewslice __pyx_v_dst_slice;
12067  __Pyx_memviewslice __pyx_v_src_slice;
12068  PyObject *__pyx_r = NULL;
12069  __Pyx_TraceDeclarations
12070  __Pyx_RefNannyDeclarations
12071  __Pyx_memviewslice *__pyx_t_1;
12072  __Pyx_memviewslice *__pyx_t_2;
12073  PyObject *__pyx_t_3 = NULL;
12074  int __pyx_t_4;
12075  int __pyx_t_5;
12076  int __pyx_t_6;
12077  int __pyx_lineno = 0;
12078  const char *__pyx_filename = NULL;
12079  int __pyx_clineno = 0;
12080  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12081  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
12082 
12083  /* "View.MemoryView":445
12084  * cdef __Pyx_memviewslice src_slice
12085  *
12086  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12087  * get_slice_from_memview(dst, &dst_slice)[0],
12088  * src.ndim, dst.ndim, self.dtype_is_object)
12089  */
12090  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
12091  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
12092 
12093  /* "View.MemoryView":446
12094  *
12095  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12096  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12097  * src.ndim, dst.ndim, self.dtype_is_object)
12098  *
12099  */
12100  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
12101  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
12102 
12103  /* "View.MemoryView":447
12104  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12105  * get_slice_from_memview(dst, &dst_slice)[0],
12106  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12107  *
12108  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12109  */
12110  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12111  __Pyx_GOTREF(__pyx_t_3);
12112  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12114  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12115  __Pyx_GOTREF(__pyx_t_3);
12116  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12117  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12118 
12119  /* "View.MemoryView":445
12120  * cdef __Pyx_memviewslice src_slice
12121  *
12122  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12123  * get_slice_from_memview(dst, &dst_slice)[0],
12124  * src.ndim, dst.ndim, self.dtype_is_object)
12125  */
12126  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
12127 
12128  /* "View.MemoryView":441
12129  * return obj
12130  *
12131  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12132  * cdef __Pyx_memviewslice dst_slice
12133  * cdef __Pyx_memviewslice src_slice
12134  */
12135 
12136  /* function exit code */
12137  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12138  goto __pyx_L0;
12139  __pyx_L1_error:;
12140  __Pyx_XDECREF(__pyx_t_3);
12141  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12142  __pyx_r = 0;
12143  __pyx_L0:;
12144  __Pyx_XGIVEREF(__pyx_r);
12145  __Pyx_TraceReturn(__pyx_r, 0);
12146  __Pyx_RefNannyFinishContext();
12147  return __pyx_r;
12148 }
12149 
12150 /* "View.MemoryView":449
12151  * src.ndim, dst.ndim, self.dtype_is_object)
12152  *
12153  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12154  * cdef int array[128]
12155  * cdef void *tmp = NULL
12156  */
12157 
12158 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12159  int __pyx_v_array[0x80];
12160  void *__pyx_v_tmp;
12161  void *__pyx_v_item;
12162  __Pyx_memviewslice *__pyx_v_dst_slice;
12163  __Pyx_memviewslice __pyx_v_tmp_slice;
12164  PyObject *__pyx_r = NULL;
12165  __Pyx_TraceDeclarations
12166  __Pyx_RefNannyDeclarations
12167  __Pyx_memviewslice *__pyx_t_1;
12168  int __pyx_t_2;
12169  PyObject *__pyx_t_3 = NULL;
12170  int __pyx_t_4;
12171  int __pyx_t_5;
12172  char const *__pyx_t_6;
12173  PyObject *__pyx_t_7 = NULL;
12174  PyObject *__pyx_t_8 = NULL;
12175  PyObject *__pyx_t_9 = NULL;
12176  PyObject *__pyx_t_10 = NULL;
12177  PyObject *__pyx_t_11 = NULL;
12178  PyObject *__pyx_t_12 = NULL;
12179  int __pyx_lineno = 0;
12180  const char *__pyx_filename = NULL;
12181  int __pyx_clineno = 0;
12182  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12183  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
12184 
12185  /* "View.MemoryView":451
12186  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12187  * cdef int array[128]
12188  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12189  * cdef void *item
12190  *
12191  */
12192  __pyx_v_tmp = NULL;
12193 
12194  /* "View.MemoryView":456
12195  * cdef __Pyx_memviewslice *dst_slice
12196  * cdef __Pyx_memviewslice tmp_slice
12197  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12198  *
12199  * if <size_t>self.view.itemsize > sizeof(array):
12200  */
12201  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12202  __pyx_v_dst_slice = __pyx_t_1;
12203 
12204  /* "View.MemoryView":458
12205  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12206  *
12207  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12208  * tmp = PyMem_Malloc(self.view.itemsize)
12209  * if tmp == NULL:
12210  */
12211  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12212  if (__pyx_t_2) {
12213 
12214  /* "View.MemoryView":459
12215  *
12216  * if <size_t>self.view.itemsize > sizeof(array):
12217  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12218  * if tmp == NULL:
12219  * raise MemoryError
12220  */
12221  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12222 
12223  /* "View.MemoryView":460
12224  * if <size_t>self.view.itemsize > sizeof(array):
12225  * tmp = PyMem_Malloc(self.view.itemsize)
12226  * if tmp == NULL: # <<<<<<<<<<<<<<
12227  * raise MemoryError
12228  * item = tmp
12229  */
12230  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12231  if (unlikely(__pyx_t_2)) {
12232 
12233  /* "View.MemoryView":461
12234  * tmp = PyMem_Malloc(self.view.itemsize)
12235  * if tmp == NULL:
12236  * raise MemoryError # <<<<<<<<<<<<<<
12237  * item = tmp
12238  * else:
12239  */
12240  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12241 
12242  /* "View.MemoryView":460
12243  * if <size_t>self.view.itemsize > sizeof(array):
12244  * tmp = PyMem_Malloc(self.view.itemsize)
12245  * if tmp == NULL: # <<<<<<<<<<<<<<
12246  * raise MemoryError
12247  * item = tmp
12248  */
12249  }
12250 
12251  /* "View.MemoryView":462
12252  * if tmp == NULL:
12253  * raise MemoryError
12254  * item = tmp # <<<<<<<<<<<<<<
12255  * else:
12256  * item = <void *> array
12257  */
12258  __pyx_v_item = __pyx_v_tmp;
12259 
12260  /* "View.MemoryView":458
12261  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12262  *
12263  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12264  * tmp = PyMem_Malloc(self.view.itemsize)
12265  * if tmp == NULL:
12266  */
12267  goto __pyx_L3;
12268  }
12269 
12270  /* "View.MemoryView":464
12271  * item = tmp
12272  * else:
12273  * item = <void *> array # <<<<<<<<<<<<<<
12274  *
12275  * try:
12276  */
12277  /*else*/ {
12278  __pyx_v_item = ((void *)__pyx_v_array);
12279  }
12280  __pyx_L3:;
12281 
12282  /* "View.MemoryView":466
12283  * item = <void *> array
12284  *
12285  * try: # <<<<<<<<<<<<<<
12286  * if self.dtype_is_object:
12287  * (<PyObject **> item)[0] = <PyObject *> value
12288  */
12289  /*try:*/ {
12290 
12291  /* "View.MemoryView":467
12292  *
12293  * try:
12294  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12295  * (<PyObject **> item)[0] = <PyObject *> value
12296  * else:
12297  */
12298  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12299  if (__pyx_t_2) {
12300 
12301  /* "View.MemoryView":468
12302  * try:
12303  * if self.dtype_is_object:
12304  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12305  * else:
12306  * self.assign_item_from_object(<char *> item, value)
12307  */
12308  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12309 
12310  /* "View.MemoryView":467
12311  *
12312  * try:
12313  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12314  * (<PyObject **> item)[0] = <PyObject *> value
12315  * else:
12316  */
12317  goto __pyx_L8;
12318  }
12319 
12320  /* "View.MemoryView":470
12321  * (<PyObject **> item)[0] = <PyObject *> value
12322  * else:
12323  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12324  *
12325  *
12326  */
12327  /*else*/ {
12328  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12329  __Pyx_GOTREF(__pyx_t_3);
12330  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12331  }
12332  __pyx_L8:;
12333 
12334  /* "View.MemoryView":474
12335  *
12336  *
12337  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12338  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12339  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12340  */
12341  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12342  if (__pyx_t_2) {
12343 
12344  /* "View.MemoryView":475
12345  *
12346  * if self.view.suboffsets != NULL:
12347  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12348  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12349  * item, self.dtype_is_object)
12350  */
12351  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12352  __Pyx_GOTREF(__pyx_t_3);
12353  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12354 
12355  /* "View.MemoryView":474
12356  *
12357  *
12358  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12359  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12360  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12361  */
12362  }
12363 
12364  /* "View.MemoryView":476
12365  * if self.view.suboffsets != NULL:
12366  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12367  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12368  * item, self.dtype_is_object)
12369  * finally:
12370  */
12371  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12372  }
12373 
12374  /* "View.MemoryView":479
12375  * item, self.dtype_is_object)
12376  * finally:
12377  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12378  *
12379  * cdef setitem_indexed(self, index, value):
12380  */
12381  /*finally:*/ {
12382  /*normal exit:*/{
12383  PyMem_Free(__pyx_v_tmp);
12384  goto __pyx_L7;
12385  }
12386  __pyx_L6_error:;
12387  /*exception exit:*/{
12388  __Pyx_PyThreadState_declare
12389  __Pyx_PyThreadState_assign
12390  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12391  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12392  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12393  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12394  __Pyx_XGOTREF(__pyx_t_7);
12395  __Pyx_XGOTREF(__pyx_t_8);
12396  __Pyx_XGOTREF(__pyx_t_9);
12397  __Pyx_XGOTREF(__pyx_t_10);
12398  __Pyx_XGOTREF(__pyx_t_11);
12399  __Pyx_XGOTREF(__pyx_t_12);
12400  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12401  {
12402  PyMem_Free(__pyx_v_tmp);
12403  }
12404  if (PY_MAJOR_VERSION >= 3) {
12405  __Pyx_XGIVEREF(__pyx_t_10);
12406  __Pyx_XGIVEREF(__pyx_t_11);
12407  __Pyx_XGIVEREF(__pyx_t_12);
12408  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12409  }
12410  __Pyx_XGIVEREF(__pyx_t_7);
12411  __Pyx_XGIVEREF(__pyx_t_8);
12412  __Pyx_XGIVEREF(__pyx_t_9);
12413  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12414  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12415  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12416  goto __pyx_L1_error;
12417  }
12418  __pyx_L7:;
12419  }
12420 
12421  /* "View.MemoryView":449
12422  * src.ndim, dst.ndim, self.dtype_is_object)
12423  *
12424  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12425  * cdef int array[128]
12426  * cdef void *tmp = NULL
12427  */
12428 
12429  /* function exit code */
12430  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12431  goto __pyx_L0;
12432  __pyx_L1_error:;
12433  __Pyx_XDECREF(__pyx_t_3);
12434  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12435  __pyx_r = 0;
12436  __pyx_L0:;
12437  __Pyx_XGIVEREF(__pyx_r);
12438  __Pyx_TraceReturn(__pyx_r, 0);
12439  __Pyx_RefNannyFinishContext();
12440  return __pyx_r;
12441 }
12442 
12443 /* "View.MemoryView":481
12444  * PyMem_Free(tmp)
12445  *
12446  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12447  * cdef char *itemp = self.get_item_pointer(index)
12448  * self.assign_item_from_object(itemp, value)
12449  */
12450 
12451 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12452  char *__pyx_v_itemp;
12453  PyObject *__pyx_r = NULL;
12454  __Pyx_TraceDeclarations
12455  __Pyx_RefNannyDeclarations
12456  char *__pyx_t_1;
12457  PyObject *__pyx_t_2 = NULL;
12458  int __pyx_lineno = 0;
12459  const char *__pyx_filename = NULL;
12460  int __pyx_clineno = 0;
12461  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12462  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
12463 
12464  /* "View.MemoryView":482
12465  *
12466  * cdef setitem_indexed(self, index, value):
12467  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12468  * self.assign_item_from_object(itemp, value)
12469  *
12470  */
12471  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12472  __pyx_v_itemp = __pyx_t_1;
12473 
12474  /* "View.MemoryView":483
12475  * cdef setitem_indexed(self, index, value):
12476  * cdef char *itemp = self.get_item_pointer(index)
12477  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12478  *
12479  * cdef convert_item_to_object(self, char *itemp):
12480  */
12481  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12482  __Pyx_GOTREF(__pyx_t_2);
12483  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12484 
12485  /* "View.MemoryView":481
12486  * PyMem_Free(tmp)
12487  *
12488  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12489  * cdef char *itemp = self.get_item_pointer(index)
12490  * self.assign_item_from_object(itemp, value)
12491  */
12492 
12493  /* function exit code */
12494  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12495  goto __pyx_L0;
12496  __pyx_L1_error:;
12497  __Pyx_XDECREF(__pyx_t_2);
12498  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12499  __pyx_r = 0;
12500  __pyx_L0:;
12501  __Pyx_XGIVEREF(__pyx_r);
12502  __Pyx_TraceReturn(__pyx_r, 0);
12503  __Pyx_RefNannyFinishContext();
12504  return __pyx_r;
12505 }
12506 
12507 /* "View.MemoryView":485
12508  * self.assign_item_from_object(itemp, value)
12509  *
12510  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12511  * """Only used if instantiated manually by the user, or if Cython doesn't
12512  * know how to convert the type"""
12513  */
12514 
12515 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12516  PyObject *__pyx_v_struct = NULL;
12517  PyObject *__pyx_v_bytesitem = 0;
12518  PyObject *__pyx_v_result = NULL;
12519  PyObject *__pyx_r = NULL;
12520  __Pyx_TraceDeclarations
12521  __Pyx_RefNannyDeclarations
12522  PyObject *__pyx_t_1 = NULL;
12523  PyObject *__pyx_t_2 = NULL;
12524  PyObject *__pyx_t_3 = NULL;
12525  PyObject *__pyx_t_4 = NULL;
12526  PyObject *__pyx_t_5 = NULL;
12527  PyObject *__pyx_t_6 = NULL;
12528  PyObject *__pyx_t_7 = NULL;
12529  int __pyx_t_8;
12530  PyObject *__pyx_t_9 = NULL;
12531  size_t __pyx_t_10;
12532  int __pyx_t_11;
12533  int __pyx_lineno = 0;
12534  const char *__pyx_filename = NULL;
12535  int __pyx_clineno = 0;
12536  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12537  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12538 
12539  /* "View.MemoryView":488
12540  * """Only used if instantiated manually by the user, or if Cython doesn't
12541  * know how to convert the type"""
12542  * import struct # <<<<<<<<<<<<<<
12543  * cdef bytes bytesitem
12544  *
12545  */
12546  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12547  __Pyx_GOTREF(__pyx_t_1);
12548  __pyx_v_struct = __pyx_t_1;
12549  __pyx_t_1 = 0;
12550 
12551  /* "View.MemoryView":491
12552  * cdef bytes bytesitem
12553  *
12554  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12555  * try:
12556  * result = struct.unpack(self.view.format, bytesitem)
12557  */
12558  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12559  __Pyx_GOTREF(__pyx_t_1);
12560  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12561  __pyx_t_1 = 0;
12562 
12563  /* "View.MemoryView":492
12564  *
12565  * bytesitem = itemp[:self.view.itemsize]
12566  * try: # <<<<<<<<<<<<<<
12567  * result = struct.unpack(self.view.format, bytesitem)
12568  * except struct.error:
12569  */
12570  {
12571  __Pyx_PyThreadState_declare
12572  __Pyx_PyThreadState_assign
12573  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12574  __Pyx_XGOTREF(__pyx_t_2);
12575  __Pyx_XGOTREF(__pyx_t_3);
12576  __Pyx_XGOTREF(__pyx_t_4);
12577  /*try:*/ {
12578 
12579  /* "View.MemoryView":493
12580  * bytesitem = itemp[:self.view.itemsize]
12581  * try:
12582  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12583  * except struct.error:
12584  * raise ValueError("Unable to convert item to object")
12585  */
12586  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12587  __Pyx_GOTREF(__pyx_t_5);
12588  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12589  __Pyx_GOTREF(__pyx_t_6);
12590  __pyx_t_7 = NULL;
12591  __pyx_t_8 = 0;
12592  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12593  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12594  if (likely(__pyx_t_7)) {
12595  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12596  __Pyx_INCREF(__pyx_t_7);
12597  __Pyx_INCREF(function);
12598  __Pyx_DECREF_SET(__pyx_t_5, function);
12599  __pyx_t_8 = 1;
12600  }
12601  }
12602  #if CYTHON_FAST_PYCALL
12603  if (PyFunction_Check(__pyx_t_5)) {
12604  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12605  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12606  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12607  __Pyx_GOTREF(__pyx_t_1);
12608  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12609  } else
12610  #endif
12611  #if CYTHON_FAST_PYCCALL
12612  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12613  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12614  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12615  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12616  __Pyx_GOTREF(__pyx_t_1);
12617  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12618  } else
12619  #endif
12620  {
12621  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12622  __Pyx_GOTREF(__pyx_t_9);
12623  if (__pyx_t_7) {
12624  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12625  }
12626  __Pyx_GIVEREF(__pyx_t_6);
12627  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12628  __Pyx_INCREF(__pyx_v_bytesitem);
12629  __Pyx_GIVEREF(__pyx_v_bytesitem);
12630  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12631  __pyx_t_6 = 0;
12632  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12633  __Pyx_GOTREF(__pyx_t_1);
12634  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12635  }
12636  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12637  __pyx_v_result = __pyx_t_1;
12638  __pyx_t_1 = 0;
12639 
12640  /* "View.MemoryView":492
12641  *
12642  * bytesitem = itemp[:self.view.itemsize]
12643  * try: # <<<<<<<<<<<<<<
12644  * result = struct.unpack(self.view.format, bytesitem)
12645  * except struct.error:
12646  */
12647  }
12648 
12649  /* "View.MemoryView":497
12650  * raise ValueError("Unable to convert item to object")
12651  * else:
12652  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12653  * return result[0]
12654  * return result
12655  */
12656  /*else:*/ {
12657  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12658  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12659  if (__pyx_t_11) {
12660 
12661  /* "View.MemoryView":498
12662  * else:
12663  * if len(self.view.format) == 1:
12664  * return result[0] # <<<<<<<<<<<<<<
12665  * return result
12666  *
12667  */
12668  __Pyx_XDECREF(__pyx_r);
12669  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12670  __Pyx_GOTREF(__pyx_t_1);
12671  __pyx_r = __pyx_t_1;
12672  __pyx_t_1 = 0;
12673  goto __pyx_L6_except_return;
12674 
12675  /* "View.MemoryView":497
12676  * raise ValueError("Unable to convert item to object")
12677  * else:
12678  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12679  * return result[0]
12680  * return result
12681  */
12682  }
12683 
12684  /* "View.MemoryView":499
12685  * if len(self.view.format) == 1:
12686  * return result[0]
12687  * return result # <<<<<<<<<<<<<<
12688  *
12689  * cdef assign_item_from_object(self, char *itemp, object value):
12690  */
12691  __Pyx_XDECREF(__pyx_r);
12692  __Pyx_INCREF(__pyx_v_result);
12693  __pyx_r = __pyx_v_result;
12694  goto __pyx_L6_except_return;
12695  }
12696  __pyx_L3_error:;
12697  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12698  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12699  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12700  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12701  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12702 
12703  /* "View.MemoryView":494
12704  * try:
12705  * result = struct.unpack(self.view.format, bytesitem)
12706  * except struct.error: # <<<<<<<<<<<<<<
12707  * raise ValueError("Unable to convert item to object")
12708  * else:
12709  */
12710  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12711  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12712  __Pyx_GOTREF(__pyx_t_6);
12713  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12714  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12715  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12716  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12717  if (__pyx_t_8) {
12718  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12719  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12720  __Pyx_GOTREF(__pyx_t_9);
12721  __Pyx_GOTREF(__pyx_t_5);
12722  __Pyx_GOTREF(__pyx_t_1);
12723 
12724  /* "View.MemoryView":495
12725  * result = struct.unpack(self.view.format, bytesitem)
12726  * except struct.error:
12727  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12728  * else:
12729  * if len(self.view.format) == 1:
12730  */
12731  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12732  __Pyx_GOTREF(__pyx_t_6);
12733  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12734  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12735  __PYX_ERR(1, 495, __pyx_L5_except_error)
12736  }
12737  goto __pyx_L5_except_error;
12738  __pyx_L5_except_error:;
12739 
12740  /* "View.MemoryView":492
12741  *
12742  * bytesitem = itemp[:self.view.itemsize]
12743  * try: # <<<<<<<<<<<<<<
12744  * result = struct.unpack(self.view.format, bytesitem)
12745  * except struct.error:
12746  */
12747  __Pyx_XGIVEREF(__pyx_t_2);
12748  __Pyx_XGIVEREF(__pyx_t_3);
12749  __Pyx_XGIVEREF(__pyx_t_4);
12750  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12751  goto __pyx_L1_error;
12752  __pyx_L6_except_return:;
12753  __Pyx_XGIVEREF(__pyx_t_2);
12754  __Pyx_XGIVEREF(__pyx_t_3);
12755  __Pyx_XGIVEREF(__pyx_t_4);
12756  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12757  goto __pyx_L0;
12758  }
12759 
12760  /* "View.MemoryView":485
12761  * self.assign_item_from_object(itemp, value)
12762  *
12763  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12764  * """Only used if instantiated manually by the user, or if Cython doesn't
12765  * know how to convert the type"""
12766  */
12767 
12768  /* function exit code */
12769  __pyx_L1_error:;
12770  __Pyx_XDECREF(__pyx_t_1);
12771  __Pyx_XDECREF(__pyx_t_5);
12772  __Pyx_XDECREF(__pyx_t_6);
12773  __Pyx_XDECREF(__pyx_t_7);
12774  __Pyx_XDECREF(__pyx_t_9);
12775  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12776  __pyx_r = 0;
12777  __pyx_L0:;
12778  __Pyx_XDECREF(__pyx_v_struct);
12779  __Pyx_XDECREF(__pyx_v_bytesitem);
12780  __Pyx_XDECREF(__pyx_v_result);
12781  __Pyx_XGIVEREF(__pyx_r);
12782  __Pyx_TraceReturn(__pyx_r, 0);
12783  __Pyx_RefNannyFinishContext();
12784  return __pyx_r;
12785 }
12786 
12787 /* "View.MemoryView":501
12788  * return result
12789  *
12790  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12791  * """Only used if instantiated manually by the user, or if Cython doesn't
12792  * know how to convert the type"""
12793  */
12794 
12795 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12796  PyObject *__pyx_v_struct = NULL;
12797  char __pyx_v_c;
12798  PyObject *__pyx_v_bytesvalue = 0;
12799  Py_ssize_t __pyx_v_i;
12800  PyObject *__pyx_r = NULL;
12801  __Pyx_TraceDeclarations
12802  __Pyx_RefNannyDeclarations
12803  PyObject *__pyx_t_1 = NULL;
12804  int __pyx_t_2;
12805  int __pyx_t_3;
12806  PyObject *__pyx_t_4 = NULL;
12807  PyObject *__pyx_t_5 = NULL;
12808  PyObject *__pyx_t_6 = NULL;
12809  int __pyx_t_7;
12810  PyObject *__pyx_t_8 = NULL;
12811  Py_ssize_t __pyx_t_9;
12812  PyObject *__pyx_t_10 = NULL;
12813  char *__pyx_t_11;
12814  char *__pyx_t_12;
12815  char *__pyx_t_13;
12816  char *__pyx_t_14;
12817  int __pyx_lineno = 0;
12818  const char *__pyx_filename = NULL;
12819  int __pyx_clineno = 0;
12820  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12821  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12822 
12823  /* "View.MemoryView":504
12824  * """Only used if instantiated manually by the user, or if Cython doesn't
12825  * know how to convert the type"""
12826  * import struct # <<<<<<<<<<<<<<
12827  * cdef char c
12828  * cdef bytes bytesvalue
12829  */
12830  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12831  __Pyx_GOTREF(__pyx_t_1);
12832  __pyx_v_struct = __pyx_t_1;
12833  __pyx_t_1 = 0;
12834 
12835  /* "View.MemoryView":509
12836  * cdef Py_ssize_t i
12837  *
12838  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12839  * bytesvalue = struct.pack(self.view.format, *value)
12840  * else:
12841  */
12842  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12843  __pyx_t_3 = (__pyx_t_2 != 0);
12844  if (__pyx_t_3) {
12845 
12846  /* "View.MemoryView":510
12847  *
12848  * if isinstance(value, tuple):
12849  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12850  * else:
12851  * bytesvalue = struct.pack(self.view.format, value)
12852  */
12853  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12854  __Pyx_GOTREF(__pyx_t_1);
12855  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12856  __Pyx_GOTREF(__pyx_t_4);
12857  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12858  __Pyx_GOTREF(__pyx_t_5);
12859  __Pyx_GIVEREF(__pyx_t_4);
12860  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12861  __pyx_t_4 = 0;
12862  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12863  __Pyx_GOTREF(__pyx_t_4);
12864  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12865  __Pyx_GOTREF(__pyx_t_6);
12866  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12867  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12868  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12869  __Pyx_GOTREF(__pyx_t_4);
12870  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12871  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12872  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12873  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12874  __pyx_t_4 = 0;
12875 
12876  /* "View.MemoryView":509
12877  * cdef Py_ssize_t i
12878  *
12879  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12880  * bytesvalue = struct.pack(self.view.format, *value)
12881  * else:
12882  */
12883  goto __pyx_L3;
12884  }
12885 
12886  /* "View.MemoryView":512
12887  * bytesvalue = struct.pack(self.view.format, *value)
12888  * else:
12889  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12890  *
12891  * for i, c in enumerate(bytesvalue):
12892  */
12893  /*else*/ {
12894  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12895  __Pyx_GOTREF(__pyx_t_6);
12896  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12897  __Pyx_GOTREF(__pyx_t_1);
12898  __pyx_t_5 = NULL;
12899  __pyx_t_7 = 0;
12900  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12901  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12902  if (likely(__pyx_t_5)) {
12903  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12904  __Pyx_INCREF(__pyx_t_5);
12905  __Pyx_INCREF(function);
12906  __Pyx_DECREF_SET(__pyx_t_6, function);
12907  __pyx_t_7 = 1;
12908  }
12909  }
12910  #if CYTHON_FAST_PYCALL
12911  if (PyFunction_Check(__pyx_t_6)) {
12912  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12913  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12914  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12915  __Pyx_GOTREF(__pyx_t_4);
12916  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12917  } else
12918  #endif
12919  #if CYTHON_FAST_PYCCALL
12920  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12921  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12922  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12923  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12924  __Pyx_GOTREF(__pyx_t_4);
12925  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12926  } else
12927  #endif
12928  {
12929  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12930  __Pyx_GOTREF(__pyx_t_8);
12931  if (__pyx_t_5) {
12932  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12933  }
12934  __Pyx_GIVEREF(__pyx_t_1);
12935  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12936  __Pyx_INCREF(__pyx_v_value);
12937  __Pyx_GIVEREF(__pyx_v_value);
12938  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12939  __pyx_t_1 = 0;
12940  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12941  __Pyx_GOTREF(__pyx_t_4);
12942  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12943  }
12944  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12945  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12946  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12947  __pyx_t_4 = 0;
12948  }
12949  __pyx_L3:;
12950 
12951  /* "View.MemoryView":514
12952  * bytesvalue = struct.pack(self.view.format, value)
12953  *
12954  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12955  * itemp[i] = c
12956  *
12957  */
12958  __pyx_t_9 = 0;
12959  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12960  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12961  __PYX_ERR(1, 514, __pyx_L1_error)
12962  }
12963  __Pyx_INCREF(__pyx_v_bytesvalue);
12964  __pyx_t_10 = __pyx_v_bytesvalue;
12965  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12966  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12967  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12968  __pyx_t_11 = __pyx_t_14;
12969  __pyx_v_c = (__pyx_t_11[0]);
12970 
12971  /* "View.MemoryView":515
12972  *
12973  * for i, c in enumerate(bytesvalue):
12974  * itemp[i] = c # <<<<<<<<<<<<<<
12975  *
12976  * @cname('getbuffer')
12977  */
12978  __pyx_v_i = __pyx_t_9;
12979 
12980  /* "View.MemoryView":514
12981  * bytesvalue = struct.pack(self.view.format, value)
12982  *
12983  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12984  * itemp[i] = c
12985  *
12986  */
12987  __pyx_t_9 = (__pyx_t_9 + 1);
12988 
12989  /* "View.MemoryView":515
12990  *
12991  * for i, c in enumerate(bytesvalue):
12992  * itemp[i] = c # <<<<<<<<<<<<<<
12993  *
12994  * @cname('getbuffer')
12995  */
12996  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12997  }
12998  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12999 
13000  /* "View.MemoryView":501
13001  * return result
13002  *
13003  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13004  * """Only used if instantiated manually by the user, or if Cython doesn't
13005  * know how to convert the type"""
13006  */
13007 
13008  /* function exit code */
13009  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13010  goto __pyx_L0;
13011  __pyx_L1_error:;
13012  __Pyx_XDECREF(__pyx_t_1);
13013  __Pyx_XDECREF(__pyx_t_4);
13014  __Pyx_XDECREF(__pyx_t_5);
13015  __Pyx_XDECREF(__pyx_t_6);
13016  __Pyx_XDECREF(__pyx_t_8);
13017  __Pyx_XDECREF(__pyx_t_10);
13018  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13019  __pyx_r = 0;
13020  __pyx_L0:;
13021  __Pyx_XDECREF(__pyx_v_struct);
13022  __Pyx_XDECREF(__pyx_v_bytesvalue);
13023  __Pyx_XGIVEREF(__pyx_r);
13024  __Pyx_TraceReturn(__pyx_r, 0);
13025  __Pyx_RefNannyFinishContext();
13026  return __pyx_r;
13027 }
13028 
13029 /* "View.MemoryView":518
13030  *
13031  * @cname('getbuffer')
13032  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13033  * if flags & PyBUF_WRITABLE and self.view.readonly:
13034  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13035  */
13036 
13037 /* Python wrapper */
13038 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13039 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13040  int __pyx_r;
13041  __Pyx_RefNannyDeclarations
13042  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13043  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13044 
13045  /* function exit code */
13046  __Pyx_RefNannyFinishContext();
13047  return __pyx_r;
13048 }
13049 
13050 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13051  int __pyx_r;
13052  __Pyx_TraceDeclarations
13053  __Pyx_RefNannyDeclarations
13054  int __pyx_t_1;
13055  int __pyx_t_2;
13056  PyObject *__pyx_t_3 = NULL;
13057  Py_ssize_t *__pyx_t_4;
13058  char *__pyx_t_5;
13059  void *__pyx_t_6;
13060  int __pyx_t_7;
13061  Py_ssize_t __pyx_t_8;
13062  int __pyx_lineno = 0;
13063  const char *__pyx_filename = NULL;
13064  int __pyx_clineno = 0;
13065  if (__pyx_v_info == NULL) {
13066  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13067  return -1;
13068  }
13069  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13070  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13071  __Pyx_GIVEREF(__pyx_v_info->obj);
13072  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
13073 
13074  /* "View.MemoryView":519
13075  * @cname('getbuffer')
13076  * def __getbuffer__(self, Py_buffer *info, int flags):
13077  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13078  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13079  *
13080  */
13081  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13082  if (__pyx_t_2) {
13083  } else {
13084  __pyx_t_1 = __pyx_t_2;
13085  goto __pyx_L4_bool_binop_done;
13086  }
13087  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13088  __pyx_t_1 = __pyx_t_2;
13089  __pyx_L4_bool_binop_done:;
13090  if (unlikely(__pyx_t_1)) {
13091 
13092  /* "View.MemoryView":520
13093  * def __getbuffer__(self, Py_buffer *info, int flags):
13094  * if flags & PyBUF_WRITABLE and self.view.readonly:
13095  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13096  *
13097  * if flags & PyBUF_ND:
13098  */
13099  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13100  __Pyx_GOTREF(__pyx_t_3);
13101  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13102  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13103  __PYX_ERR(1, 520, __pyx_L1_error)
13104 
13105  /* "View.MemoryView":519
13106  * @cname('getbuffer')
13107  * def __getbuffer__(self, Py_buffer *info, int flags):
13108  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13109  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13110  *
13111  */
13112  }
13113 
13114  /* "View.MemoryView":522
13115  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13116  *
13117  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13118  * info.shape = self.view.shape
13119  * else:
13120  */
13121  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13122  if (__pyx_t_1) {
13123 
13124  /* "View.MemoryView":523
13125  *
13126  * if flags & PyBUF_ND:
13127  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13128  * else:
13129  * info.shape = NULL
13130  */
13131  __pyx_t_4 = __pyx_v_self->view.shape;
13132  __pyx_v_info->shape = __pyx_t_4;
13133 
13134  /* "View.MemoryView":522
13135  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13136  *
13137  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13138  * info.shape = self.view.shape
13139  * else:
13140  */
13141  goto __pyx_L6;
13142  }
13143 
13144  /* "View.MemoryView":525
13145  * info.shape = self.view.shape
13146  * else:
13147  * info.shape = NULL # <<<<<<<<<<<<<<
13148  *
13149  * if flags & PyBUF_STRIDES:
13150  */
13151  /*else*/ {
13152  __pyx_v_info->shape = NULL;
13153  }
13154  __pyx_L6:;
13155 
13156  /* "View.MemoryView":527
13157  * info.shape = NULL
13158  *
13159  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13160  * info.strides = self.view.strides
13161  * else:
13162  */
13163  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13164  if (__pyx_t_1) {
13165 
13166  /* "View.MemoryView":528
13167  *
13168  * if flags & PyBUF_STRIDES:
13169  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13170  * else:
13171  * info.strides = NULL
13172  */
13173  __pyx_t_4 = __pyx_v_self->view.strides;
13174  __pyx_v_info->strides = __pyx_t_4;
13175 
13176  /* "View.MemoryView":527
13177  * info.shape = NULL
13178  *
13179  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13180  * info.strides = self.view.strides
13181  * else:
13182  */
13183  goto __pyx_L7;
13184  }
13185 
13186  /* "View.MemoryView":530
13187  * info.strides = self.view.strides
13188  * else:
13189  * info.strides = NULL # <<<<<<<<<<<<<<
13190  *
13191  * if flags & PyBUF_INDIRECT:
13192  */
13193  /*else*/ {
13194  __pyx_v_info->strides = NULL;
13195  }
13196  __pyx_L7:;
13197 
13198  /* "View.MemoryView":532
13199  * info.strides = NULL
13200  *
13201  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13202  * info.suboffsets = self.view.suboffsets
13203  * else:
13204  */
13205  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13206  if (__pyx_t_1) {
13207 
13208  /* "View.MemoryView":533
13209  *
13210  * if flags & PyBUF_INDIRECT:
13211  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13212  * else:
13213  * info.suboffsets = NULL
13214  */
13215  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13216  __pyx_v_info->suboffsets = __pyx_t_4;
13217 
13218  /* "View.MemoryView":532
13219  * info.strides = NULL
13220  *
13221  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13222  * info.suboffsets = self.view.suboffsets
13223  * else:
13224  */
13225  goto __pyx_L8;
13226  }
13227 
13228  /* "View.MemoryView":535
13229  * info.suboffsets = self.view.suboffsets
13230  * else:
13231  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13232  *
13233  * if flags & PyBUF_FORMAT:
13234  */
13235  /*else*/ {
13236  __pyx_v_info->suboffsets = NULL;
13237  }
13238  __pyx_L8:;
13239 
13240  /* "View.MemoryView":537
13241  * info.suboffsets = NULL
13242  *
13243  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13244  * info.format = self.view.format
13245  * else:
13246  */
13247  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13248  if (__pyx_t_1) {
13249 
13250  /* "View.MemoryView":538
13251  *
13252  * if flags & PyBUF_FORMAT:
13253  * info.format = self.view.format # <<<<<<<<<<<<<<
13254  * else:
13255  * info.format = NULL
13256  */
13257  __pyx_t_5 = __pyx_v_self->view.format;
13258  __pyx_v_info->format = __pyx_t_5;
13259 
13260  /* "View.MemoryView":537
13261  * info.suboffsets = NULL
13262  *
13263  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13264  * info.format = self.view.format
13265  * else:
13266  */
13267  goto __pyx_L9;
13268  }
13269 
13270  /* "View.MemoryView":540
13271  * info.format = self.view.format
13272  * else:
13273  * info.format = NULL # <<<<<<<<<<<<<<
13274  *
13275  * info.buf = self.view.buf
13276  */
13277  /*else*/ {
13278  __pyx_v_info->format = NULL;
13279  }
13280  __pyx_L9:;
13281 
13282  /* "View.MemoryView":542
13283  * info.format = NULL
13284  *
13285  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13286  * info.ndim = self.view.ndim
13287  * info.itemsize = self.view.itemsize
13288  */
13289  __pyx_t_6 = __pyx_v_self->view.buf;
13290  __pyx_v_info->buf = __pyx_t_6;
13291 
13292  /* "View.MemoryView":543
13293  *
13294  * info.buf = self.view.buf
13295  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13296  * info.itemsize = self.view.itemsize
13297  * info.len = self.view.len
13298  */
13299  __pyx_t_7 = __pyx_v_self->view.ndim;
13300  __pyx_v_info->ndim = __pyx_t_7;
13301 
13302  /* "View.MemoryView":544
13303  * info.buf = self.view.buf
13304  * info.ndim = self.view.ndim
13305  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13306  * info.len = self.view.len
13307  * info.readonly = self.view.readonly
13308  */
13309  __pyx_t_8 = __pyx_v_self->view.itemsize;
13310  __pyx_v_info->itemsize = __pyx_t_8;
13311 
13312  /* "View.MemoryView":545
13313  * info.ndim = self.view.ndim
13314  * info.itemsize = self.view.itemsize
13315  * info.len = self.view.len # <<<<<<<<<<<<<<
13316  * info.readonly = self.view.readonly
13317  * info.obj = self
13318  */
13319  __pyx_t_8 = __pyx_v_self->view.len;
13320  __pyx_v_info->len = __pyx_t_8;
13321 
13322  /* "View.MemoryView":546
13323  * info.itemsize = self.view.itemsize
13324  * info.len = self.view.len
13325  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13326  * info.obj = self
13327  *
13328  */
13329  __pyx_t_1 = __pyx_v_self->view.readonly;
13330  __pyx_v_info->readonly = __pyx_t_1;
13331 
13332  /* "View.MemoryView":547
13333  * info.len = self.view.len
13334  * info.readonly = self.view.readonly
13335  * info.obj = self # <<<<<<<<<<<<<<
13336  *
13337  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13338  */
13339  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13340  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13341  __Pyx_GOTREF(__pyx_v_info->obj);
13342  __Pyx_DECREF(__pyx_v_info->obj);
13343  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13344 
13345  /* "View.MemoryView":518
13346  *
13347  * @cname('getbuffer')
13348  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13349  * if flags & PyBUF_WRITABLE and self.view.readonly:
13350  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13351  */
13352 
13353  /* function exit code */
13354  __pyx_r = 0;
13355  goto __pyx_L0;
13356  __pyx_L1_error:;
13357  __Pyx_XDECREF(__pyx_t_3);
13358  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13359  __pyx_r = -1;
13360  if (__pyx_v_info->obj != NULL) {
13361  __Pyx_GOTREF(__pyx_v_info->obj);
13362  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13363  }
13364  goto __pyx_L2;
13365  __pyx_L0:;
13366  if (__pyx_v_info->obj == Py_None) {
13367  __Pyx_GOTREF(__pyx_v_info->obj);
13368  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13369  }
13370  __pyx_L2:;
13371  __Pyx_TraceReturn(Py_None, 0);
13372  __Pyx_RefNannyFinishContext();
13373  return __pyx_r;
13374 }
13375 
13376 /* "View.MemoryView":553
13377  *
13378  * @property
13379  * def T(self): # <<<<<<<<<<<<<<
13380  * cdef _memoryviewslice result = memoryview_copy(self)
13381  * transpose_memslice(&result.from_slice)
13382  */
13383 
13384 /* Python wrapper */
13385 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13386 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13387  PyObject *__pyx_r = 0;
13388  __Pyx_RefNannyDeclarations
13389  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13390  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13391 
13392  /* function exit code */
13393  __Pyx_RefNannyFinishContext();
13394  return __pyx_r;
13395 }
13396 
13397 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13398  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13399  PyObject *__pyx_r = NULL;
13400  __Pyx_TraceDeclarations
13401  __Pyx_RefNannyDeclarations
13402  PyObject *__pyx_t_1 = NULL;
13403  int __pyx_t_2;
13404  int __pyx_lineno = 0;
13405  const char *__pyx_filename = NULL;
13406  int __pyx_clineno = 0;
13407  __Pyx_RefNannySetupContext("__get__", 0);
13408  __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
13409 
13410  /* "View.MemoryView":554
13411  * @property
13412  * def T(self):
13413  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13414  * transpose_memslice(&result.from_slice)
13415  * return result
13416  */
13417  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13418  __Pyx_GOTREF(__pyx_t_1);
13419  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13420  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13421  __pyx_t_1 = 0;
13422 
13423  /* "View.MemoryView":555
13424  * def T(self):
13425  * cdef _memoryviewslice result = memoryview_copy(self)
13426  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13427  * return result
13428  *
13429  */
13430  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13431 
13432  /* "View.MemoryView":556
13433  * cdef _memoryviewslice result = memoryview_copy(self)
13434  * transpose_memslice(&result.from_slice)
13435  * return result # <<<<<<<<<<<<<<
13436  *
13437  * @property
13438  */
13439  __Pyx_XDECREF(__pyx_r);
13440  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13441  __pyx_r = ((PyObject *)__pyx_v_result);
13442  goto __pyx_L0;
13443 
13444  /* "View.MemoryView":553
13445  *
13446  * @property
13447  * def T(self): # <<<<<<<<<<<<<<
13448  * cdef _memoryviewslice result = memoryview_copy(self)
13449  * transpose_memslice(&result.from_slice)
13450  */
13451 
13452  /* function exit code */
13453  __pyx_L1_error:;
13454  __Pyx_XDECREF(__pyx_t_1);
13455  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13456  __pyx_r = NULL;
13457  __pyx_L0:;
13458  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13459  __Pyx_XGIVEREF(__pyx_r);
13460  __Pyx_TraceReturn(__pyx_r, 0);
13461  __Pyx_RefNannyFinishContext();
13462  return __pyx_r;
13463 }
13464 
13465 /* "View.MemoryView":559
13466  *
13467  * @property
13468  * def base(self): # <<<<<<<<<<<<<<
13469  * return self.obj
13470  *
13471  */
13472 
13473 /* Python wrapper */
13474 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13475 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13476  PyObject *__pyx_r = 0;
13477  __Pyx_RefNannyDeclarations
13478  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13479  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13480 
13481  /* function exit code */
13482  __Pyx_RefNannyFinishContext();
13483  return __pyx_r;
13484 }
13485 
13486 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13487  PyObject *__pyx_r = NULL;
13488  __Pyx_TraceDeclarations
13489  __Pyx_RefNannyDeclarations
13490  int __pyx_lineno = 0;
13491  const char *__pyx_filename = NULL;
13492  int __pyx_clineno = 0;
13493  __Pyx_RefNannySetupContext("__get__", 0);
13494  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
13495 
13496  /* "View.MemoryView":560
13497  * @property
13498  * def base(self):
13499  * return self.obj # <<<<<<<<<<<<<<
13500  *
13501  * @property
13502  */
13503  __Pyx_XDECREF(__pyx_r);
13504  __Pyx_INCREF(__pyx_v_self->obj);
13505  __pyx_r = __pyx_v_self->obj;
13506  goto __pyx_L0;
13507 
13508  /* "View.MemoryView":559
13509  *
13510  * @property
13511  * def base(self): # <<<<<<<<<<<<<<
13512  * return self.obj
13513  *
13514  */
13515 
13516  /* function exit code */
13517  __pyx_L1_error:;
13518  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13519  __pyx_r = NULL;
13520  __pyx_L0:;
13521  __Pyx_XGIVEREF(__pyx_r);
13522  __Pyx_TraceReturn(__pyx_r, 0);
13523  __Pyx_RefNannyFinishContext();
13524  return __pyx_r;
13525 }
13526 
13527 /* "View.MemoryView":563
13528  *
13529  * @property
13530  * def shape(self): # <<<<<<<<<<<<<<
13531  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13532  *
13533  */
13534 
13535 /* Python wrapper */
13536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13538  PyObject *__pyx_r = 0;
13539  __Pyx_RefNannyDeclarations
13540  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13541  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13542 
13543  /* function exit code */
13544  __Pyx_RefNannyFinishContext();
13545  return __pyx_r;
13546 }
13547 
13548 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13549  Py_ssize_t __pyx_v_length;
13550  PyObject *__pyx_r = NULL;
13551  __Pyx_TraceDeclarations
13552  __Pyx_RefNannyDeclarations
13553  PyObject *__pyx_t_1 = NULL;
13554  Py_ssize_t *__pyx_t_2;
13555  Py_ssize_t *__pyx_t_3;
13556  Py_ssize_t *__pyx_t_4;
13557  PyObject *__pyx_t_5 = NULL;
13558  int __pyx_lineno = 0;
13559  const char *__pyx_filename = NULL;
13560  int __pyx_clineno = 0;
13561  __Pyx_RefNannySetupContext("__get__", 0);
13562  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13563 
13564  /* "View.MemoryView":564
13565  * @property
13566  * def shape(self):
13567  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13568  *
13569  * @property
13570  */
13571  __Pyx_XDECREF(__pyx_r);
13572  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13573  __Pyx_GOTREF(__pyx_t_1);
13574  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13575  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13576  __pyx_t_2 = __pyx_t_4;
13577  __pyx_v_length = (__pyx_t_2[0]);
13578  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13579  __Pyx_GOTREF(__pyx_t_5);
13580  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13581  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13582  }
13583  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13584  __Pyx_GOTREF(__pyx_t_5);
13585  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13586  __pyx_r = __pyx_t_5;
13587  __pyx_t_5 = 0;
13588  goto __pyx_L0;
13589 
13590  /* "View.MemoryView":563
13591  *
13592  * @property
13593  * def shape(self): # <<<<<<<<<<<<<<
13594  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13595  *
13596  */
13597 
13598  /* function exit code */
13599  __pyx_L1_error:;
13600  __Pyx_XDECREF(__pyx_t_1);
13601  __Pyx_XDECREF(__pyx_t_5);
13602  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13603  __pyx_r = NULL;
13604  __pyx_L0:;
13605  __Pyx_XGIVEREF(__pyx_r);
13606  __Pyx_TraceReturn(__pyx_r, 0);
13607  __Pyx_RefNannyFinishContext();
13608  return __pyx_r;
13609 }
13610 
13611 /* "View.MemoryView":567
13612  *
13613  * @property
13614  * def strides(self): # <<<<<<<<<<<<<<
13615  * if self.view.strides == NULL:
13616  *
13617  */
13618 
13619 /* Python wrapper */
13620 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13621 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13622  PyObject *__pyx_r = 0;
13623  __Pyx_RefNannyDeclarations
13624  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13625  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13626 
13627  /* function exit code */
13628  __Pyx_RefNannyFinishContext();
13629  return __pyx_r;
13630 }
13631 
13632 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13633  Py_ssize_t __pyx_v_stride;
13634  PyObject *__pyx_r = NULL;
13635  __Pyx_TraceDeclarations
13636  __Pyx_RefNannyDeclarations
13637  int __pyx_t_1;
13638  PyObject *__pyx_t_2 = NULL;
13639  Py_ssize_t *__pyx_t_3;
13640  Py_ssize_t *__pyx_t_4;
13641  Py_ssize_t *__pyx_t_5;
13642  PyObject *__pyx_t_6 = NULL;
13643  int __pyx_lineno = 0;
13644  const char *__pyx_filename = NULL;
13645  int __pyx_clineno = 0;
13646  __Pyx_RefNannySetupContext("__get__", 0);
13647  __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13648 
13649  /* "View.MemoryView":568
13650  * @property
13651  * def strides(self):
13652  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13653  *
13654  * raise ValueError("Buffer view does not expose strides")
13655  */
13656  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13657  if (unlikely(__pyx_t_1)) {
13658 
13659  /* "View.MemoryView":570
13660  * if self.view.strides == NULL:
13661  *
13662  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13663  *
13664  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13665  */
13666  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13667  __Pyx_GOTREF(__pyx_t_2);
13668  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13669  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13670  __PYX_ERR(1, 570, __pyx_L1_error)
13671 
13672  /* "View.MemoryView":568
13673  * @property
13674  * def strides(self):
13675  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13676  *
13677  * raise ValueError("Buffer view does not expose strides")
13678  */
13679  }
13680 
13681  /* "View.MemoryView":572
13682  * raise ValueError("Buffer view does not expose strides")
13683  *
13684  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13685  *
13686  * @property
13687  */
13688  __Pyx_XDECREF(__pyx_r);
13689  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13690  __Pyx_GOTREF(__pyx_t_2);
13691  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13692  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13693  __pyx_t_3 = __pyx_t_5;
13694  __pyx_v_stride = (__pyx_t_3[0]);
13695  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13696  __Pyx_GOTREF(__pyx_t_6);
13697  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13698  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13699  }
13700  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13701  __Pyx_GOTREF(__pyx_t_6);
13702  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13703  __pyx_r = __pyx_t_6;
13704  __pyx_t_6 = 0;
13705  goto __pyx_L0;
13706 
13707  /* "View.MemoryView":567
13708  *
13709  * @property
13710  * def strides(self): # <<<<<<<<<<<<<<
13711  * if self.view.strides == NULL:
13712  *
13713  */
13714 
13715  /* function exit code */
13716  __pyx_L1_error:;
13717  __Pyx_XDECREF(__pyx_t_2);
13718  __Pyx_XDECREF(__pyx_t_6);
13719  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13720  __pyx_r = NULL;
13721  __pyx_L0:;
13722  __Pyx_XGIVEREF(__pyx_r);
13723  __Pyx_TraceReturn(__pyx_r, 0);
13724  __Pyx_RefNannyFinishContext();
13725  return __pyx_r;
13726 }
13727 
13728 /* "View.MemoryView":575
13729  *
13730  * @property
13731  * def suboffsets(self): # <<<<<<<<<<<<<<
13732  * if self.view.suboffsets == NULL:
13733  * return (-1,) * self.view.ndim
13734  */
13735 
13736 /* Python wrapper */
13737 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13738 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13739  PyObject *__pyx_r = 0;
13740  __Pyx_RefNannyDeclarations
13741  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13742  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13743 
13744  /* function exit code */
13745  __Pyx_RefNannyFinishContext();
13746  return __pyx_r;
13747 }
13748 
13749 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13750  Py_ssize_t __pyx_v_suboffset;
13751  PyObject *__pyx_r = NULL;
13752  __Pyx_TraceDeclarations
13753  __Pyx_RefNannyDeclarations
13754  int __pyx_t_1;
13755  PyObject *__pyx_t_2 = NULL;
13756  PyObject *__pyx_t_3 = NULL;
13757  Py_ssize_t *__pyx_t_4;
13758  Py_ssize_t *__pyx_t_5;
13759  Py_ssize_t *__pyx_t_6;
13760  int __pyx_lineno = 0;
13761  const char *__pyx_filename = NULL;
13762  int __pyx_clineno = 0;
13763  __Pyx_RefNannySetupContext("__get__", 0);
13764  __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13765 
13766  /* "View.MemoryView":576
13767  * @property
13768  * def suboffsets(self):
13769  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13770  * return (-1,) * self.view.ndim
13771  *
13772  */
13773  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13774  if (__pyx_t_1) {
13775 
13776  /* "View.MemoryView":577
13777  * def suboffsets(self):
13778  * if self.view.suboffsets == NULL:
13779  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13780  *
13781  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13782  */
13783  __Pyx_XDECREF(__pyx_r);
13784  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13785  __Pyx_GOTREF(__pyx_t_2);
13786  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__31, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13787  __Pyx_GOTREF(__pyx_t_3);
13788  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13789  __pyx_r = __pyx_t_3;
13790  __pyx_t_3 = 0;
13791  goto __pyx_L0;
13792 
13793  /* "View.MemoryView":576
13794  * @property
13795  * def suboffsets(self):
13796  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13797  * return (-1,) * self.view.ndim
13798  *
13799  */
13800  }
13801 
13802  /* "View.MemoryView":579
13803  * return (-1,) * self.view.ndim
13804  *
13805  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13806  *
13807  * @property
13808  */
13809  __Pyx_XDECREF(__pyx_r);
13810  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13811  __Pyx_GOTREF(__pyx_t_3);
13812  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13813  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13814  __pyx_t_4 = __pyx_t_6;
13815  __pyx_v_suboffset = (__pyx_t_4[0]);
13816  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13817  __Pyx_GOTREF(__pyx_t_2);
13818  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13819  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13820  }
13821  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13822  __Pyx_GOTREF(__pyx_t_2);
13823  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13824  __pyx_r = __pyx_t_2;
13825  __pyx_t_2 = 0;
13826  goto __pyx_L0;
13827 
13828  /* "View.MemoryView":575
13829  *
13830  * @property
13831  * def suboffsets(self): # <<<<<<<<<<<<<<
13832  * if self.view.suboffsets == NULL:
13833  * return (-1,) * self.view.ndim
13834  */
13835 
13836  /* function exit code */
13837  __pyx_L1_error:;
13838  __Pyx_XDECREF(__pyx_t_2);
13839  __Pyx_XDECREF(__pyx_t_3);
13840  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13841  __pyx_r = NULL;
13842  __pyx_L0:;
13843  __Pyx_XGIVEREF(__pyx_r);
13844  __Pyx_TraceReturn(__pyx_r, 0);
13845  __Pyx_RefNannyFinishContext();
13846  return __pyx_r;
13847 }
13848 
13849 /* "View.MemoryView":582
13850  *
13851  * @property
13852  * def ndim(self): # <<<<<<<<<<<<<<
13853  * return self.view.ndim
13854  *
13855  */
13856 
13857 /* Python wrapper */
13858 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13859 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13860  PyObject *__pyx_r = 0;
13861  __Pyx_RefNannyDeclarations
13862  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13863  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13864 
13865  /* function exit code */
13866  __Pyx_RefNannyFinishContext();
13867  return __pyx_r;
13868 }
13869 
13870 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13871  PyObject *__pyx_r = NULL;
13872  __Pyx_TraceDeclarations
13873  __Pyx_RefNannyDeclarations
13874  PyObject *__pyx_t_1 = NULL;
13875  int __pyx_lineno = 0;
13876  const char *__pyx_filename = NULL;
13877  int __pyx_clineno = 0;
13878  __Pyx_RefNannySetupContext("__get__", 0);
13879  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13880 
13881  /* "View.MemoryView":583
13882  * @property
13883  * def ndim(self):
13884  * return self.view.ndim # <<<<<<<<<<<<<<
13885  *
13886  * @property
13887  */
13888  __Pyx_XDECREF(__pyx_r);
13889  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13890  __Pyx_GOTREF(__pyx_t_1);
13891  __pyx_r = __pyx_t_1;
13892  __pyx_t_1 = 0;
13893  goto __pyx_L0;
13894 
13895  /* "View.MemoryView":582
13896  *
13897  * @property
13898  * def ndim(self): # <<<<<<<<<<<<<<
13899  * return self.view.ndim
13900  *
13901  */
13902 
13903  /* function exit code */
13904  __pyx_L1_error:;
13905  __Pyx_XDECREF(__pyx_t_1);
13906  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13907  __pyx_r = NULL;
13908  __pyx_L0:;
13909  __Pyx_XGIVEREF(__pyx_r);
13910  __Pyx_TraceReturn(__pyx_r, 0);
13911  __Pyx_RefNannyFinishContext();
13912  return __pyx_r;
13913 }
13914 
13915 /* "View.MemoryView":586
13916  *
13917  * @property
13918  * def itemsize(self): # <<<<<<<<<<<<<<
13919  * return self.view.itemsize
13920  *
13921  */
13922 
13923 /* Python wrapper */
13924 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13925 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13926  PyObject *__pyx_r = 0;
13927  __Pyx_RefNannyDeclarations
13928  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13929  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13930 
13931  /* function exit code */
13932  __Pyx_RefNannyFinishContext();
13933  return __pyx_r;
13934 }
13935 
13936 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13937  PyObject *__pyx_r = NULL;
13938  __Pyx_TraceDeclarations
13939  __Pyx_RefNannyDeclarations
13940  PyObject *__pyx_t_1 = NULL;
13941  int __pyx_lineno = 0;
13942  const char *__pyx_filename = NULL;
13943  int __pyx_clineno = 0;
13944  __Pyx_RefNannySetupContext("__get__", 0);
13945  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13946 
13947  /* "View.MemoryView":587
13948  * @property
13949  * def itemsize(self):
13950  * return self.view.itemsize # <<<<<<<<<<<<<<
13951  *
13952  * @property
13953  */
13954  __Pyx_XDECREF(__pyx_r);
13955  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13956  __Pyx_GOTREF(__pyx_t_1);
13957  __pyx_r = __pyx_t_1;
13958  __pyx_t_1 = 0;
13959  goto __pyx_L0;
13960 
13961  /* "View.MemoryView":586
13962  *
13963  * @property
13964  * def itemsize(self): # <<<<<<<<<<<<<<
13965  * return self.view.itemsize
13966  *
13967  */
13968 
13969  /* function exit code */
13970  __pyx_L1_error:;
13971  __Pyx_XDECREF(__pyx_t_1);
13972  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13973  __pyx_r = NULL;
13974  __pyx_L0:;
13975  __Pyx_XGIVEREF(__pyx_r);
13976  __Pyx_TraceReturn(__pyx_r, 0);
13977  __Pyx_RefNannyFinishContext();
13978  return __pyx_r;
13979 }
13980 
13981 /* "View.MemoryView":590
13982  *
13983  * @property
13984  * def nbytes(self): # <<<<<<<<<<<<<<
13985  * return self.size * self.view.itemsize
13986  *
13987  */
13988 
13989 /* Python wrapper */
13990 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13991 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13992  PyObject *__pyx_r = 0;
13993  __Pyx_RefNannyDeclarations
13994  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13995  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13996 
13997  /* function exit code */
13998  __Pyx_RefNannyFinishContext();
13999  return __pyx_r;
14000 }
14001 
14002 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14003  PyObject *__pyx_r = NULL;
14004  __Pyx_TraceDeclarations
14005  __Pyx_RefNannyDeclarations
14006  PyObject *__pyx_t_1 = NULL;
14007  PyObject *__pyx_t_2 = NULL;
14008  PyObject *__pyx_t_3 = NULL;
14009  int __pyx_lineno = 0;
14010  const char *__pyx_filename = NULL;
14011  int __pyx_clineno = 0;
14012  __Pyx_RefNannySetupContext("__get__", 0);
14013  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
14014 
14015  /* "View.MemoryView":591
14016  * @property
14017  * def nbytes(self):
14018  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14019  *
14020  * @property
14021  */
14022  __Pyx_XDECREF(__pyx_r);
14023  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14024  __Pyx_GOTREF(__pyx_t_1);
14025  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14026  __Pyx_GOTREF(__pyx_t_2);
14027  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14028  __Pyx_GOTREF(__pyx_t_3);
14029  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14030  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14031  __pyx_r = __pyx_t_3;
14032  __pyx_t_3 = 0;
14033  goto __pyx_L0;
14034 
14035  /* "View.MemoryView":590
14036  *
14037  * @property
14038  * def nbytes(self): # <<<<<<<<<<<<<<
14039  * return self.size * self.view.itemsize
14040  *
14041  */
14042 
14043  /* function exit code */
14044  __pyx_L1_error:;
14045  __Pyx_XDECREF(__pyx_t_1);
14046  __Pyx_XDECREF(__pyx_t_2);
14047  __Pyx_XDECREF(__pyx_t_3);
14048  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14049  __pyx_r = NULL;
14050  __pyx_L0:;
14051  __Pyx_XGIVEREF(__pyx_r);
14052  __Pyx_TraceReturn(__pyx_r, 0);
14053  __Pyx_RefNannyFinishContext();
14054  return __pyx_r;
14055 }
14056 
14057 /* "View.MemoryView":594
14058  *
14059  * @property
14060  * def size(self): # <<<<<<<<<<<<<<
14061  * if self._size is None:
14062  * result = 1
14063  */
14064 
14065 /* Python wrapper */
14066 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14067 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14068  PyObject *__pyx_r = 0;
14069  __Pyx_RefNannyDeclarations
14070  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14071  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14072 
14073  /* function exit code */
14074  __Pyx_RefNannyFinishContext();
14075  return __pyx_r;
14076 }
14077 
14078 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14079  PyObject *__pyx_v_result = NULL;
14080  PyObject *__pyx_v_length = NULL;
14081  PyObject *__pyx_r = NULL;
14082  __Pyx_TraceDeclarations
14083  __Pyx_RefNannyDeclarations
14084  int __pyx_t_1;
14085  int __pyx_t_2;
14086  Py_ssize_t *__pyx_t_3;
14087  Py_ssize_t *__pyx_t_4;
14088  Py_ssize_t *__pyx_t_5;
14089  PyObject *__pyx_t_6 = NULL;
14090  int __pyx_lineno = 0;
14091  const char *__pyx_filename = NULL;
14092  int __pyx_clineno = 0;
14093  __Pyx_RefNannySetupContext("__get__", 0);
14094  __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
14095 
14096  /* "View.MemoryView":595
14097  * @property
14098  * def size(self):
14099  * if self._size is None: # <<<<<<<<<<<<<<
14100  * result = 1
14101  *
14102  */
14103  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14104  __pyx_t_2 = (__pyx_t_1 != 0);
14105  if (__pyx_t_2) {
14106 
14107  /* "View.MemoryView":596
14108  * def size(self):
14109  * if self._size is None:
14110  * result = 1 # <<<<<<<<<<<<<<
14111  *
14112  * for length in self.view.shape[:self.view.ndim]:
14113  */
14114  __Pyx_INCREF(__pyx_int_1);
14115  __pyx_v_result = __pyx_int_1;
14116 
14117  /* "View.MemoryView":598
14118  * result = 1
14119  *
14120  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14121  * result *= length
14122  *
14123  */
14124  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14125  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14126  __pyx_t_3 = __pyx_t_5;
14127  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14128  __Pyx_GOTREF(__pyx_t_6);
14129  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14130  __pyx_t_6 = 0;
14131 
14132  /* "View.MemoryView":599
14133  *
14134  * for length in self.view.shape[:self.view.ndim]:
14135  * result *= length # <<<<<<<<<<<<<<
14136  *
14137  * self._size = result
14138  */
14139  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14140  __Pyx_GOTREF(__pyx_t_6);
14141  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14142  __pyx_t_6 = 0;
14143  }
14144 
14145  /* "View.MemoryView":601
14146  * result *= length
14147  *
14148  * self._size = result # <<<<<<<<<<<<<<
14149  *
14150  * return self._size
14151  */
14152  __Pyx_INCREF(__pyx_v_result);
14153  __Pyx_GIVEREF(__pyx_v_result);
14154  __Pyx_GOTREF(__pyx_v_self->_size);
14155  __Pyx_DECREF(__pyx_v_self->_size);
14156  __pyx_v_self->_size = __pyx_v_result;
14157 
14158  /* "View.MemoryView":595
14159  * @property
14160  * def size(self):
14161  * if self._size is None: # <<<<<<<<<<<<<<
14162  * result = 1
14163  *
14164  */
14165  }
14166 
14167  /* "View.MemoryView":603
14168  * self._size = result
14169  *
14170  * return self._size # <<<<<<<<<<<<<<
14171  *
14172  * def __len__(self):
14173  */
14174  __Pyx_XDECREF(__pyx_r);
14175  __Pyx_INCREF(__pyx_v_self->_size);
14176  __pyx_r = __pyx_v_self->_size;
14177  goto __pyx_L0;
14178 
14179  /* "View.MemoryView":594
14180  *
14181  * @property
14182  * def size(self): # <<<<<<<<<<<<<<
14183  * if self._size is None:
14184  * result = 1
14185  */
14186 
14187  /* function exit code */
14188  __pyx_L1_error:;
14189  __Pyx_XDECREF(__pyx_t_6);
14190  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14191  __pyx_r = NULL;
14192  __pyx_L0:;
14193  __Pyx_XDECREF(__pyx_v_result);
14194  __Pyx_XDECREF(__pyx_v_length);
14195  __Pyx_XGIVEREF(__pyx_r);
14196  __Pyx_TraceReturn(__pyx_r, 0);
14197  __Pyx_RefNannyFinishContext();
14198  return __pyx_r;
14199 }
14200 
14201 /* "View.MemoryView":605
14202  * return self._size
14203  *
14204  * def __len__(self): # <<<<<<<<<<<<<<
14205  * if self.view.ndim >= 1:
14206  * return self.view.shape[0]
14207  */
14208 
14209 /* Python wrapper */
14210 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14211 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14212  Py_ssize_t __pyx_r;
14213  __Pyx_RefNannyDeclarations
14214  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14215  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14216 
14217  /* function exit code */
14218  __Pyx_RefNannyFinishContext();
14219  return __pyx_r;
14220 }
14221 
14222 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14223  Py_ssize_t __pyx_r;
14224  __Pyx_TraceDeclarations
14225  __Pyx_RefNannyDeclarations
14226  int __pyx_t_1;
14227  int __pyx_lineno = 0;
14228  const char *__pyx_filename = NULL;
14229  int __pyx_clineno = 0;
14230  __Pyx_RefNannySetupContext("__len__", 0);
14231  __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
14232 
14233  /* "View.MemoryView":606
14234  *
14235  * def __len__(self):
14236  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14237  * return self.view.shape[0]
14238  *
14239  */
14240  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14241  if (__pyx_t_1) {
14242 
14243  /* "View.MemoryView":607
14244  * def __len__(self):
14245  * if self.view.ndim >= 1:
14246  * return self.view.shape[0] # <<<<<<<<<<<<<<
14247  *
14248  * return 0
14249  */
14250  __pyx_r = (__pyx_v_self->view.shape[0]);
14251  goto __pyx_L0;
14252 
14253  /* "View.MemoryView":606
14254  *
14255  * def __len__(self):
14256  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14257  * return self.view.shape[0]
14258  *
14259  */
14260  }
14261 
14262  /* "View.MemoryView":609
14263  * return self.view.shape[0]
14264  *
14265  * return 0 # <<<<<<<<<<<<<<
14266  *
14267  * def __repr__(self):
14268  */
14269  __pyx_r = 0;
14270  goto __pyx_L0;
14271 
14272  /* "View.MemoryView":605
14273  * return self._size
14274  *
14275  * def __len__(self): # <<<<<<<<<<<<<<
14276  * if self.view.ndim >= 1:
14277  * return self.view.shape[0]
14278  */
14279 
14280  /* function exit code */
14281  __pyx_L1_error:;
14282  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14283  __pyx_r = -1;
14284  __pyx_L0:;
14285  __Pyx_TraceReturn(Py_None, 0);
14286  __Pyx_RefNannyFinishContext();
14287  return __pyx_r;
14288 }
14289 
14290 /* "View.MemoryView":611
14291  * return 0
14292  *
14293  * def __repr__(self): # <<<<<<<<<<<<<<
14294  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14295  * id(self))
14296  */
14297 
14298 /* Python wrapper */
14299 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14300 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14301  PyObject *__pyx_r = 0;
14302  __Pyx_RefNannyDeclarations
14303  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14304  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14305 
14306  /* function exit code */
14307  __Pyx_RefNannyFinishContext();
14308  return __pyx_r;
14309 }
14310 
14311 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14312  PyObject *__pyx_r = NULL;
14313  __Pyx_TraceDeclarations
14314  __Pyx_RefNannyDeclarations
14315  PyObject *__pyx_t_1 = NULL;
14316  PyObject *__pyx_t_2 = NULL;
14317  PyObject *__pyx_t_3 = NULL;
14318  int __pyx_lineno = 0;
14319  const char *__pyx_filename = NULL;
14320  int __pyx_clineno = 0;
14321  __Pyx_RefNannySetupContext("__repr__", 0);
14322  __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
14323 
14324  /* "View.MemoryView":612
14325  *
14326  * def __repr__(self):
14327  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14328  * id(self))
14329  *
14330  */
14331  __Pyx_XDECREF(__pyx_r);
14332  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14333  __Pyx_GOTREF(__pyx_t_1);
14334  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14335  __Pyx_GOTREF(__pyx_t_2);
14336  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14337  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14338  __Pyx_GOTREF(__pyx_t_1);
14339  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14340 
14341  /* "View.MemoryView":613
14342  * def __repr__(self):
14343  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14344  * id(self)) # <<<<<<<<<<<<<<
14345  *
14346  * def __str__(self):
14347  */
14348  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14349  __Pyx_GOTREF(__pyx_t_2);
14350 
14351  /* "View.MemoryView":612
14352  *
14353  * def __repr__(self):
14354  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14355  * id(self))
14356  *
14357  */
14358  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14359  __Pyx_GOTREF(__pyx_t_3);
14360  __Pyx_GIVEREF(__pyx_t_1);
14361  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14362  __Pyx_GIVEREF(__pyx_t_2);
14363  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14364  __pyx_t_1 = 0;
14365  __pyx_t_2 = 0;
14366  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14367  __Pyx_GOTREF(__pyx_t_2);
14368  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14369  __pyx_r = __pyx_t_2;
14370  __pyx_t_2 = 0;
14371  goto __pyx_L0;
14372 
14373  /* "View.MemoryView":611
14374  * return 0
14375  *
14376  * def __repr__(self): # <<<<<<<<<<<<<<
14377  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14378  * id(self))
14379  */
14380 
14381  /* function exit code */
14382  __pyx_L1_error:;
14383  __Pyx_XDECREF(__pyx_t_1);
14384  __Pyx_XDECREF(__pyx_t_2);
14385  __Pyx_XDECREF(__pyx_t_3);
14386  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14387  __pyx_r = NULL;
14388  __pyx_L0:;
14389  __Pyx_XGIVEREF(__pyx_r);
14390  __Pyx_TraceReturn(__pyx_r, 0);
14391  __Pyx_RefNannyFinishContext();
14392  return __pyx_r;
14393 }
14394 
14395 /* "View.MemoryView":615
14396  * id(self))
14397  *
14398  * def __str__(self): # <<<<<<<<<<<<<<
14399  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14400  *
14401  */
14402 
14403 /* Python wrapper */
14404 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14405 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14406  PyObject *__pyx_r = 0;
14407  __Pyx_RefNannyDeclarations
14408  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14409  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14410 
14411  /* function exit code */
14412  __Pyx_RefNannyFinishContext();
14413  return __pyx_r;
14414 }
14415 
14416 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14417  PyObject *__pyx_r = NULL;
14418  __Pyx_TraceDeclarations
14419  __Pyx_RefNannyDeclarations
14420  PyObject *__pyx_t_1 = NULL;
14421  PyObject *__pyx_t_2 = NULL;
14422  int __pyx_lineno = 0;
14423  const char *__pyx_filename = NULL;
14424  int __pyx_clineno = 0;
14425  __Pyx_RefNannySetupContext("__str__", 0);
14426  __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
14427 
14428  /* "View.MemoryView":616
14429  *
14430  * def __str__(self):
14431  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14432  *
14433  *
14434  */
14435  __Pyx_XDECREF(__pyx_r);
14436  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14437  __Pyx_GOTREF(__pyx_t_1);
14438  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14439  __Pyx_GOTREF(__pyx_t_2);
14440  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14441  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14442  __Pyx_GOTREF(__pyx_t_1);
14443  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14444  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14445  __Pyx_GOTREF(__pyx_t_2);
14446  __Pyx_GIVEREF(__pyx_t_1);
14447  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14448  __pyx_t_1 = 0;
14449  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14450  __Pyx_GOTREF(__pyx_t_1);
14451  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14452  __pyx_r = __pyx_t_1;
14453  __pyx_t_1 = 0;
14454  goto __pyx_L0;
14455 
14456  /* "View.MemoryView":615
14457  * id(self))
14458  *
14459  * def __str__(self): # <<<<<<<<<<<<<<
14460  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14461  *
14462  */
14463 
14464  /* function exit code */
14465  __pyx_L1_error:;
14466  __Pyx_XDECREF(__pyx_t_1);
14467  __Pyx_XDECREF(__pyx_t_2);
14468  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14469  __pyx_r = NULL;
14470  __pyx_L0:;
14471  __Pyx_XGIVEREF(__pyx_r);
14472  __Pyx_TraceReturn(__pyx_r, 0);
14473  __Pyx_RefNannyFinishContext();
14474  return __pyx_r;
14475 }
14476 
14477 /* "View.MemoryView":619
14478  *
14479  *
14480  * def is_c_contig(self): # <<<<<<<<<<<<<<
14481  * cdef __Pyx_memviewslice *mslice
14482  * cdef __Pyx_memviewslice tmp
14483  */
14484 
14485 /* Python wrapper */
14486 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14487 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14488 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14489  PyObject *__pyx_r = 0;
14490  __Pyx_RefNannyDeclarations
14491  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14492  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14493 
14494  /* function exit code */
14495  __Pyx_RefNannyFinishContext();
14496  return __pyx_r;
14497 }
14498 
14499 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14500  __Pyx_memviewslice *__pyx_v_mslice;
14501  __Pyx_memviewslice __pyx_v_tmp;
14502  PyObject *__pyx_r = NULL;
14503  __Pyx_TraceDeclarations
14504  __Pyx_RefNannyDeclarations
14505  __Pyx_memviewslice *__pyx_t_1;
14506  PyObject *__pyx_t_2 = NULL;
14507  int __pyx_lineno = 0;
14508  const char *__pyx_filename = NULL;
14509  int __pyx_clineno = 0;
14510  __Pyx_RefNannySetupContext("is_c_contig", 0);
14511  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
14512 
14513  /* "View.MemoryView":622
14514  * cdef __Pyx_memviewslice *mslice
14515  * cdef __Pyx_memviewslice tmp
14516  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14517  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14518  *
14519  */
14520  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14521  __pyx_v_mslice = __pyx_t_1;
14522 
14523  /* "View.MemoryView":623
14524  * cdef __Pyx_memviewslice tmp
14525  * mslice = get_slice_from_memview(self, &tmp)
14526  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14527  *
14528  * def is_f_contig(self):
14529  */
14530  __Pyx_XDECREF(__pyx_r);
14531  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14532  __Pyx_GOTREF(__pyx_t_2);
14533  __pyx_r = __pyx_t_2;
14534  __pyx_t_2 = 0;
14535  goto __pyx_L0;
14536 
14537  /* "View.MemoryView":619
14538  *
14539  *
14540  * def is_c_contig(self): # <<<<<<<<<<<<<<
14541  * cdef __Pyx_memviewslice *mslice
14542  * cdef __Pyx_memviewslice tmp
14543  */
14544 
14545  /* function exit code */
14546  __pyx_L1_error:;
14547  __Pyx_XDECREF(__pyx_t_2);
14548  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14549  __pyx_r = NULL;
14550  __pyx_L0:;
14551  __Pyx_XGIVEREF(__pyx_r);
14552  __Pyx_TraceReturn(__pyx_r, 0);
14553  __Pyx_RefNannyFinishContext();
14554  return __pyx_r;
14555 }
14556 
14557 /* "View.MemoryView":625
14558  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14559  *
14560  * def is_f_contig(self): # <<<<<<<<<<<<<<
14561  * cdef __Pyx_memviewslice *mslice
14562  * cdef __Pyx_memviewslice tmp
14563  */
14564 
14565 /* Python wrapper */
14566 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14567 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14568 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14569  PyObject *__pyx_r = 0;
14570  __Pyx_RefNannyDeclarations
14571  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14572  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14573 
14574  /* function exit code */
14575  __Pyx_RefNannyFinishContext();
14576  return __pyx_r;
14577 }
14578 
14579 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14580  __Pyx_memviewslice *__pyx_v_mslice;
14581  __Pyx_memviewslice __pyx_v_tmp;
14582  PyObject *__pyx_r = NULL;
14583  __Pyx_TraceDeclarations
14584  __Pyx_RefNannyDeclarations
14585  __Pyx_memviewslice *__pyx_t_1;
14586  PyObject *__pyx_t_2 = NULL;
14587  int __pyx_lineno = 0;
14588  const char *__pyx_filename = NULL;
14589  int __pyx_clineno = 0;
14590  __Pyx_RefNannySetupContext("is_f_contig", 0);
14591  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14592 
14593  /* "View.MemoryView":628
14594  * cdef __Pyx_memviewslice *mslice
14595  * cdef __Pyx_memviewslice tmp
14596  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14597  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14598  *
14599  */
14600  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14601  __pyx_v_mslice = __pyx_t_1;
14602 
14603  /* "View.MemoryView":629
14604  * cdef __Pyx_memviewslice tmp
14605  * mslice = get_slice_from_memview(self, &tmp)
14606  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14607  *
14608  * def copy(self):
14609  */
14610  __Pyx_XDECREF(__pyx_r);
14611  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14612  __Pyx_GOTREF(__pyx_t_2);
14613  __pyx_r = __pyx_t_2;
14614  __pyx_t_2 = 0;
14615  goto __pyx_L0;
14616 
14617  /* "View.MemoryView":625
14618  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14619  *
14620  * def is_f_contig(self): # <<<<<<<<<<<<<<
14621  * cdef __Pyx_memviewslice *mslice
14622  * cdef __Pyx_memviewslice tmp
14623  */
14624 
14625  /* function exit code */
14626  __pyx_L1_error:;
14627  __Pyx_XDECREF(__pyx_t_2);
14628  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14629  __pyx_r = NULL;
14630  __pyx_L0:;
14631  __Pyx_XGIVEREF(__pyx_r);
14632  __Pyx_TraceReturn(__pyx_r, 0);
14633  __Pyx_RefNannyFinishContext();
14634  return __pyx_r;
14635 }
14636 
14637 /* "View.MemoryView":631
14638  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14639  *
14640  * def copy(self): # <<<<<<<<<<<<<<
14641  * cdef __Pyx_memviewslice mslice
14642  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14643  */
14644 
14645 /* Python wrapper */
14646 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14647 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14648 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14649  PyObject *__pyx_r = 0;
14650  __Pyx_RefNannyDeclarations
14651  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14652  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14653 
14654  /* function exit code */
14655  __Pyx_RefNannyFinishContext();
14656  return __pyx_r;
14657 }
14658 
14659 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14660  __Pyx_memviewslice __pyx_v_mslice;
14661  int __pyx_v_flags;
14662  PyObject *__pyx_r = NULL;
14663  __Pyx_TraceDeclarations
14664  __Pyx_RefNannyDeclarations
14665  __Pyx_memviewslice __pyx_t_1;
14666  PyObject *__pyx_t_2 = NULL;
14667  int __pyx_lineno = 0;
14668  const char *__pyx_filename = NULL;
14669  int __pyx_clineno = 0;
14670  __Pyx_RefNannySetupContext("copy", 0);
14671  __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14672 
14673  /* "View.MemoryView":633
14674  * def copy(self):
14675  * cdef __Pyx_memviewslice mslice
14676  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14677  *
14678  * slice_copy(self, &mslice)
14679  */
14680  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14681 
14682  /* "View.MemoryView":635
14683  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14684  *
14685  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14686  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14687  * self.view.itemsize,
14688  */
14689  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14690 
14691  /* "View.MemoryView":636
14692  *
14693  * slice_copy(self, &mslice)
14694  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14695  * self.view.itemsize,
14696  * flags|PyBUF_C_CONTIGUOUS,
14697  */
14698  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14699  __pyx_v_mslice = __pyx_t_1;
14700 
14701  /* "View.MemoryView":641
14702  * self.dtype_is_object)
14703  *
14704  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14705  *
14706  * def copy_fortran(self):
14707  */
14708  __Pyx_XDECREF(__pyx_r);
14709  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14710  __Pyx_GOTREF(__pyx_t_2);
14711  __pyx_r = __pyx_t_2;
14712  __pyx_t_2 = 0;
14713  goto __pyx_L0;
14714 
14715  /* "View.MemoryView":631
14716  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14717  *
14718  * def copy(self): # <<<<<<<<<<<<<<
14719  * cdef __Pyx_memviewslice mslice
14720  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14721  */
14722 
14723  /* function exit code */
14724  __pyx_L1_error:;
14725  __Pyx_XDECREF(__pyx_t_2);
14726  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14727  __pyx_r = NULL;
14728  __pyx_L0:;
14729  __Pyx_XGIVEREF(__pyx_r);
14730  __Pyx_TraceReturn(__pyx_r, 0);
14731  __Pyx_RefNannyFinishContext();
14732  return __pyx_r;
14733 }
14734 
14735 /* "View.MemoryView":643
14736  * return memoryview_copy_from_slice(self, &mslice)
14737  *
14738  * def copy_fortran(self): # <<<<<<<<<<<<<<
14739  * cdef __Pyx_memviewslice src, dst
14740  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14741  */
14742 
14743 /* Python wrapper */
14744 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14745 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14746 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14747  PyObject *__pyx_r = 0;
14748  __Pyx_RefNannyDeclarations
14749  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14750  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14751 
14752  /* function exit code */
14753  __Pyx_RefNannyFinishContext();
14754  return __pyx_r;
14755 }
14756 
14757 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14758  __Pyx_memviewslice __pyx_v_src;
14759  __Pyx_memviewslice __pyx_v_dst;
14760  int __pyx_v_flags;
14761  PyObject *__pyx_r = NULL;
14762  __Pyx_TraceDeclarations
14763  __Pyx_RefNannyDeclarations
14764  __Pyx_memviewslice __pyx_t_1;
14765  PyObject *__pyx_t_2 = NULL;
14766  int __pyx_lineno = 0;
14767  const char *__pyx_filename = NULL;
14768  int __pyx_clineno = 0;
14769  __Pyx_RefNannySetupContext("copy_fortran", 0);
14770  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14771 
14772  /* "View.MemoryView":645
14773  * def copy_fortran(self):
14774  * cdef __Pyx_memviewslice src, dst
14775  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14776  *
14777  * slice_copy(self, &src)
14778  */
14779  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14780 
14781  /* "View.MemoryView":647
14782  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14783  *
14784  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14785  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14786  * self.view.itemsize,
14787  */
14788  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14789 
14790  /* "View.MemoryView":648
14791  *
14792  * slice_copy(self, &src)
14793  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14794  * self.view.itemsize,
14795  * flags|PyBUF_F_CONTIGUOUS,
14796  */
14797  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14798  __pyx_v_dst = __pyx_t_1;
14799 
14800  /* "View.MemoryView":653
14801  * self.dtype_is_object)
14802  *
14803  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14804  *
14805  *
14806  */
14807  __Pyx_XDECREF(__pyx_r);
14808  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14809  __Pyx_GOTREF(__pyx_t_2);
14810  __pyx_r = __pyx_t_2;
14811  __pyx_t_2 = 0;
14812  goto __pyx_L0;
14813 
14814  /* "View.MemoryView":643
14815  * return memoryview_copy_from_slice(self, &mslice)
14816  *
14817  * def copy_fortran(self): # <<<<<<<<<<<<<<
14818  * cdef __Pyx_memviewslice src, dst
14819  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14820  */
14821 
14822  /* function exit code */
14823  __pyx_L1_error:;
14824  __Pyx_XDECREF(__pyx_t_2);
14825  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14826  __pyx_r = NULL;
14827  __pyx_L0:;
14828  __Pyx_XGIVEREF(__pyx_r);
14829  __Pyx_TraceReturn(__pyx_r, 0);
14830  __Pyx_RefNannyFinishContext();
14831  return __pyx_r;
14832 }
14833 
14834 /* "(tree fragment)":1
14835  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14836  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14837  * def __setstate_cython__(self, __pyx_state):
14838  */
14839 
14840 /* Python wrapper */
14841 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14842 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14843 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14844  PyObject *__pyx_r = 0;
14845  __Pyx_RefNannyDeclarations
14846  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14847  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14848 
14849  /* function exit code */
14850  __Pyx_RefNannyFinishContext();
14851  return __pyx_r;
14852 }
14853 
14854 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14855  PyObject *__pyx_r = NULL;
14856  __Pyx_TraceDeclarations
14857  __Pyx_RefNannyDeclarations
14858  PyObject *__pyx_t_1 = NULL;
14859  int __pyx_lineno = 0;
14860  const char *__pyx_filename = NULL;
14861  int __pyx_clineno = 0;
14862  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14863  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14864 
14865  /* "(tree fragment)":2
14866  * def __reduce_cython__(self):
14867  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14868  * def __setstate_cython__(self, __pyx_state):
14869  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14870  */
14871  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14872  __Pyx_GOTREF(__pyx_t_1);
14873  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14874  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14875  __PYX_ERR(1, 2, __pyx_L1_error)
14876 
14877  /* "(tree fragment)":1
14878  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14879  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14880  * def __setstate_cython__(self, __pyx_state):
14881  */
14882 
14883  /* function exit code */
14884  __pyx_L1_error:;
14885  __Pyx_XDECREF(__pyx_t_1);
14886  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14887  __pyx_r = NULL;
14888  __Pyx_XGIVEREF(__pyx_r);
14889  __Pyx_TraceReturn(__pyx_r, 0);
14890  __Pyx_RefNannyFinishContext();
14891  return __pyx_r;
14892 }
14893 
14894 /* "(tree fragment)":3
14895  * def __reduce_cython__(self):
14896  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14897  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14898  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14899  */
14900 
14901 /* Python wrapper */
14902 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14903 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14904 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14905  PyObject *__pyx_r = 0;
14906  __Pyx_RefNannyDeclarations
14907  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14908  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14909 
14910  /* function exit code */
14911  __Pyx_RefNannyFinishContext();
14912  return __pyx_r;
14913 }
14914 
14915 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14916  PyObject *__pyx_r = NULL;
14917  __Pyx_TraceDeclarations
14918  __Pyx_RefNannyDeclarations
14919  PyObject *__pyx_t_1 = NULL;
14920  int __pyx_lineno = 0;
14921  const char *__pyx_filename = NULL;
14922  int __pyx_clineno = 0;
14923  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14924  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14925 
14926  /* "(tree fragment)":4
14927  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14928  * def __setstate_cython__(self, __pyx_state):
14929  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14930  */
14931  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14932  __Pyx_GOTREF(__pyx_t_1);
14933  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14934  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14935  __PYX_ERR(1, 4, __pyx_L1_error)
14936 
14937  /* "(tree fragment)":3
14938  * def __reduce_cython__(self):
14939  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14940  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14941  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14942  */
14943 
14944  /* function exit code */
14945  __pyx_L1_error:;
14946  __Pyx_XDECREF(__pyx_t_1);
14947  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14948  __pyx_r = NULL;
14949  __Pyx_XGIVEREF(__pyx_r);
14950  __Pyx_TraceReturn(__pyx_r, 0);
14951  __Pyx_RefNannyFinishContext();
14952  return __pyx_r;
14953 }
14954 
14955 /* "View.MemoryView":657
14956  *
14957  * @cname('__pyx_memoryview_new')
14958  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14959  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14960  * result.typeinfo = typeinfo
14961  */
14962 
14963 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14964  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14965  PyObject *__pyx_r = NULL;
14966  __Pyx_TraceDeclarations
14967  __Pyx_RefNannyDeclarations
14968  PyObject *__pyx_t_1 = NULL;
14969  PyObject *__pyx_t_2 = NULL;
14970  PyObject *__pyx_t_3 = NULL;
14971  int __pyx_lineno = 0;
14972  const char *__pyx_filename = NULL;
14973  int __pyx_clineno = 0;
14974  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14975  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14976 
14977  /* "View.MemoryView":658
14978  * @cname('__pyx_memoryview_new')
14979  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14980  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14981  * result.typeinfo = typeinfo
14982  * return result
14983  */
14984  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14985  __Pyx_GOTREF(__pyx_t_1);
14986  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14987  __Pyx_GOTREF(__pyx_t_2);
14988  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14989  __Pyx_GOTREF(__pyx_t_3);
14990  __Pyx_INCREF(__pyx_v_o);
14991  __Pyx_GIVEREF(__pyx_v_o);
14992  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14993  __Pyx_GIVEREF(__pyx_t_1);
14994  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14995  __Pyx_GIVEREF(__pyx_t_2);
14996  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14997  __pyx_t_1 = 0;
14998  __pyx_t_2 = 0;
14999  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15000  __Pyx_GOTREF(__pyx_t_2);
15001  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15002  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15003  __pyx_t_2 = 0;
15004 
15005  /* "View.MemoryView":659
15006  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15007  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15008  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15009  * return result
15010  *
15011  */
15012  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15013 
15014  /* "View.MemoryView":660
15015  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15016  * result.typeinfo = typeinfo
15017  * return result # <<<<<<<<<<<<<<
15018  *
15019  * @cname('__pyx_memoryview_check')
15020  */
15021  __Pyx_XDECREF(__pyx_r);
15022  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15023  __pyx_r = ((PyObject *)__pyx_v_result);
15024  goto __pyx_L0;
15025 
15026  /* "View.MemoryView":657
15027  *
15028  * @cname('__pyx_memoryview_new')
15029  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15030  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15031  * result.typeinfo = typeinfo
15032  */
15033 
15034  /* function exit code */
15035  __pyx_L1_error:;
15036  __Pyx_XDECREF(__pyx_t_1);
15037  __Pyx_XDECREF(__pyx_t_2);
15038  __Pyx_XDECREF(__pyx_t_3);
15039  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15040  __pyx_r = 0;
15041  __pyx_L0:;
15042  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15043  __Pyx_XGIVEREF(__pyx_r);
15044  __Pyx_TraceReturn(__pyx_r, 0);
15045  __Pyx_RefNannyFinishContext();
15046  return __pyx_r;
15047 }
15048 
15049 /* "View.MemoryView":663
15050  *
15051  * @cname('__pyx_memoryview_check')
15052  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15053  * return isinstance(o, memoryview)
15054  *
15055  */
15056 
15057 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15058  int __pyx_r;
15059  __Pyx_TraceDeclarations
15060  __Pyx_RefNannyDeclarations
15061  int __pyx_t_1;
15062  int __pyx_lineno = 0;
15063  const char *__pyx_filename = NULL;
15064  int __pyx_clineno = 0;
15065  __Pyx_RefNannySetupContext("memoryview_check", 0);
15066  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
15067 
15068  /* "View.MemoryView":664
15069  * @cname('__pyx_memoryview_check')
15070  * cdef inline bint memoryview_check(object o):
15071  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15072  *
15073  * cdef tuple _unellipsify(object index, int ndim):
15074  */
15075  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15076  __pyx_r = __pyx_t_1;
15077  goto __pyx_L0;
15078 
15079  /* "View.MemoryView":663
15080  *
15081  * @cname('__pyx_memoryview_check')
15082  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15083  * return isinstance(o, memoryview)
15084  *
15085  */
15086 
15087  /* function exit code */
15088  __pyx_L1_error:;
15089  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15090  __pyx_r = 0;
15091  __pyx_L0:;
15092  __Pyx_TraceReturn(Py_None, 0);
15093  __Pyx_RefNannyFinishContext();
15094  return __pyx_r;
15095 }
15096 
15097 /* "View.MemoryView":666
15098  * return isinstance(o, memoryview)
15099  *
15100  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15101  * """
15102  * Replace all ellipses with full slices and fill incomplete indices with
15103  */
15104 
15105 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15106  PyObject *__pyx_v_tup = NULL;
15107  PyObject *__pyx_v_result = NULL;
15108  int __pyx_v_have_slices;
15109  int __pyx_v_seen_ellipsis;
15110  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15111  PyObject *__pyx_v_item = NULL;
15112  Py_ssize_t __pyx_v_nslices;
15113  PyObject *__pyx_r = NULL;
15114  __Pyx_TraceDeclarations
15115  __Pyx_RefNannyDeclarations
15116  int __pyx_t_1;
15117  int __pyx_t_2;
15118  PyObject *__pyx_t_3 = NULL;
15119  PyObject *__pyx_t_4 = NULL;
15120  Py_ssize_t __pyx_t_5;
15121  PyObject *(*__pyx_t_6)(PyObject *);
15122  PyObject *__pyx_t_7 = NULL;
15123  Py_ssize_t __pyx_t_8;
15124  int __pyx_t_9;
15125  int __pyx_t_10;
15126  PyObject *__pyx_t_11 = NULL;
15127  int __pyx_lineno = 0;
15128  const char *__pyx_filename = NULL;
15129  int __pyx_clineno = 0;
15130  __Pyx_RefNannySetupContext("_unellipsify", 0);
15131  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
15132 
15133  /* "View.MemoryView":671
15134  * full slices.
15135  * """
15136  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15137  * tup = (index,)
15138  * else:
15139  */
15140  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15141  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15142  if (__pyx_t_2) {
15143 
15144  /* "View.MemoryView":672
15145  * """
15146  * if not isinstance(index, tuple):
15147  * tup = (index,) # <<<<<<<<<<<<<<
15148  * else:
15149  * tup = index
15150  */
15151  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15152  __Pyx_GOTREF(__pyx_t_3);
15153  __Pyx_INCREF(__pyx_v_index);
15154  __Pyx_GIVEREF(__pyx_v_index);
15155  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15156  __pyx_v_tup = __pyx_t_3;
15157  __pyx_t_3 = 0;
15158 
15159  /* "View.MemoryView":671
15160  * full slices.
15161  * """
15162  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15163  * tup = (index,)
15164  * else:
15165  */
15166  goto __pyx_L3;
15167  }
15168 
15169  /* "View.MemoryView":674
15170  * tup = (index,)
15171  * else:
15172  * tup = index # <<<<<<<<<<<<<<
15173  *
15174  * result = []
15175  */
15176  /*else*/ {
15177  __Pyx_INCREF(__pyx_v_index);
15178  __pyx_v_tup = __pyx_v_index;
15179  }
15180  __pyx_L3:;
15181 
15182  /* "View.MemoryView":676
15183  * tup = index
15184  *
15185  * result = [] # <<<<<<<<<<<<<<
15186  * have_slices = False
15187  * seen_ellipsis = False
15188  */
15189  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15190  __Pyx_GOTREF(__pyx_t_3);
15191  __pyx_v_result = ((PyObject*)__pyx_t_3);
15192  __pyx_t_3 = 0;
15193 
15194  /* "View.MemoryView":677
15195  *
15196  * result = []
15197  * have_slices = False # <<<<<<<<<<<<<<
15198  * seen_ellipsis = False
15199  * for idx, item in enumerate(tup):
15200  */
15201  __pyx_v_have_slices = 0;
15202 
15203  /* "View.MemoryView":678
15204  * result = []
15205  * have_slices = False
15206  * seen_ellipsis = False # <<<<<<<<<<<<<<
15207  * for idx, item in enumerate(tup):
15208  * if item is Ellipsis:
15209  */
15210  __pyx_v_seen_ellipsis = 0;
15211 
15212  /* "View.MemoryView":679
15213  * have_slices = False
15214  * seen_ellipsis = False
15215  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15216  * if item is Ellipsis:
15217  * if not seen_ellipsis:
15218  */
15219  __Pyx_INCREF(__pyx_int_0);
15220  __pyx_t_3 = __pyx_int_0;
15221  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15222  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15223  __pyx_t_6 = NULL;
15224  } else {
15225  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15226  __Pyx_GOTREF(__pyx_t_4);
15227  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15228  }
15229  for (;;) {
15230  if (likely(!__pyx_t_6)) {
15231  if (likely(PyList_CheckExact(__pyx_t_4))) {
15232  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15233  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15234  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15235  #else
15236  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15237  __Pyx_GOTREF(__pyx_t_7);
15238  #endif
15239  } else {
15240  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15241  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15242  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15243  #else
15244  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15245  __Pyx_GOTREF(__pyx_t_7);
15246  #endif
15247  }
15248  } else {
15249  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15250  if (unlikely(!__pyx_t_7)) {
15251  PyObject* exc_type = PyErr_Occurred();
15252  if (exc_type) {
15253  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15254  else __PYX_ERR(1, 679, __pyx_L1_error)
15255  }
15256  break;
15257  }
15258  __Pyx_GOTREF(__pyx_t_7);
15259  }
15260  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15261  __pyx_t_7 = 0;
15262  __Pyx_INCREF(__pyx_t_3);
15263  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15264  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15265  __Pyx_GOTREF(__pyx_t_7);
15266  __Pyx_DECREF(__pyx_t_3);
15267  __pyx_t_3 = __pyx_t_7;
15268  __pyx_t_7 = 0;
15269 
15270  /* "View.MemoryView":680
15271  * seen_ellipsis = False
15272  * for idx, item in enumerate(tup):
15273  * if item is Ellipsis: # <<<<<<<<<<<<<<
15274  * if not seen_ellipsis:
15275  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15276  */
15277  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15278  __pyx_t_1 = (__pyx_t_2 != 0);
15279  if (__pyx_t_1) {
15280 
15281  /* "View.MemoryView":681
15282  * for idx, item in enumerate(tup):
15283  * if item is Ellipsis:
15284  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15285  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15286  * seen_ellipsis = True
15287  */
15288  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15289  if (__pyx_t_1) {
15290 
15291  /* "View.MemoryView":682
15292  * if item is Ellipsis:
15293  * if not seen_ellipsis:
15294  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15295  * seen_ellipsis = True
15296  * else:
15297  */
15298  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15299  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15300  __Pyx_GOTREF(__pyx_t_7);
15301  { Py_ssize_t __pyx_temp;
15302  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15303  __Pyx_INCREF(__pyx_slice__7);
15304  __Pyx_GIVEREF(__pyx_slice__7);
15305  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
15306  }
15307  }
15308  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15309  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15310 
15311  /* "View.MemoryView":683
15312  * if not seen_ellipsis:
15313  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15314  * seen_ellipsis = True # <<<<<<<<<<<<<<
15315  * else:
15316  * result.append(slice(None))
15317  */
15318  __pyx_v_seen_ellipsis = 1;
15319 
15320  /* "View.MemoryView":681
15321  * for idx, item in enumerate(tup):
15322  * if item is Ellipsis:
15323  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15324  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15325  * seen_ellipsis = True
15326  */
15327  goto __pyx_L7;
15328  }
15329 
15330  /* "View.MemoryView":685
15331  * seen_ellipsis = True
15332  * else:
15333  * result.append(slice(None)) # <<<<<<<<<<<<<<
15334  * have_slices = True
15335  * else:
15336  */
15337  /*else*/ {
15338  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15339  }
15340  __pyx_L7:;
15341 
15342  /* "View.MemoryView":686
15343  * else:
15344  * result.append(slice(None))
15345  * have_slices = True # <<<<<<<<<<<<<<
15346  * else:
15347  * if not isinstance(item, slice) and not PyIndex_Check(item):
15348  */
15349  __pyx_v_have_slices = 1;
15350 
15351  /* "View.MemoryView":680
15352  * seen_ellipsis = False
15353  * for idx, item in enumerate(tup):
15354  * if item is Ellipsis: # <<<<<<<<<<<<<<
15355  * if not seen_ellipsis:
15356  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15357  */
15358  goto __pyx_L6;
15359  }
15360 
15361  /* "View.MemoryView":688
15362  * have_slices = True
15363  * else:
15364  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15365  * raise TypeError("Cannot index with type '%s'" % type(item))
15366  *
15367  */
15368  /*else*/ {
15369  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15370  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15371  if (__pyx_t_10) {
15372  } else {
15373  __pyx_t_1 = __pyx_t_10;
15374  goto __pyx_L9_bool_binop_done;
15375  }
15376  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15377  __pyx_t_1 = __pyx_t_10;
15378  __pyx_L9_bool_binop_done:;
15379  if (unlikely(__pyx_t_1)) {
15380 
15381  /* "View.MemoryView":689
15382  * else:
15383  * if not isinstance(item, slice) and not PyIndex_Check(item):
15384  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15385  *
15386  * have_slices = have_slices or isinstance(item, slice)
15387  */
15388  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15389  __Pyx_GOTREF(__pyx_t_7);
15390  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15391  __Pyx_GOTREF(__pyx_t_11);
15392  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15393  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15394  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15395  __PYX_ERR(1, 689, __pyx_L1_error)
15396 
15397  /* "View.MemoryView":688
15398  * have_slices = True
15399  * else:
15400  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15401  * raise TypeError("Cannot index with type '%s'" % type(item))
15402  *
15403  */
15404  }
15405 
15406  /* "View.MemoryView":691
15407  * raise TypeError("Cannot index with type '%s'" % type(item))
15408  *
15409  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15410  * result.append(item)
15411  *
15412  */
15413  __pyx_t_10 = (__pyx_v_have_slices != 0);
15414  if (!__pyx_t_10) {
15415  } else {
15416  __pyx_t_1 = __pyx_t_10;
15417  goto __pyx_L11_bool_binop_done;
15418  }
15419  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15420  __pyx_t_2 = (__pyx_t_10 != 0);
15421  __pyx_t_1 = __pyx_t_2;
15422  __pyx_L11_bool_binop_done:;
15423  __pyx_v_have_slices = __pyx_t_1;
15424 
15425  /* "View.MemoryView":692
15426  *
15427  * have_slices = have_slices or isinstance(item, slice)
15428  * result.append(item) # <<<<<<<<<<<<<<
15429  *
15430  * nslices = ndim - len(result)
15431  */
15432  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15433  }
15434  __pyx_L6:;
15435 
15436  /* "View.MemoryView":679
15437  * have_slices = False
15438  * seen_ellipsis = False
15439  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15440  * if item is Ellipsis:
15441  * if not seen_ellipsis:
15442  */
15443  }
15444  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15445  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15446 
15447  /* "View.MemoryView":694
15448  * result.append(item)
15449  *
15450  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15451  * if nslices:
15452  * result.extend([slice(None)] * nslices)
15453  */
15454  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15455  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15456 
15457  /* "View.MemoryView":695
15458  *
15459  * nslices = ndim - len(result)
15460  * if nslices: # <<<<<<<<<<<<<<
15461  * result.extend([slice(None)] * nslices)
15462  *
15463  */
15464  __pyx_t_1 = (__pyx_v_nslices != 0);
15465  if (__pyx_t_1) {
15466 
15467  /* "View.MemoryView":696
15468  * nslices = ndim - len(result)
15469  * if nslices:
15470  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15471  *
15472  * return have_slices or nslices, tuple(result)
15473  */
15474  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15475  __Pyx_GOTREF(__pyx_t_3);
15476  { Py_ssize_t __pyx_temp;
15477  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15478  __Pyx_INCREF(__pyx_slice__7);
15479  __Pyx_GIVEREF(__pyx_slice__7);
15480  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15481  }
15482  }
15483  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15484  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15485 
15486  /* "View.MemoryView":695
15487  *
15488  * nslices = ndim - len(result)
15489  * if nslices: # <<<<<<<<<<<<<<
15490  * result.extend([slice(None)] * nslices)
15491  *
15492  */
15493  }
15494 
15495  /* "View.MemoryView":698
15496  * result.extend([slice(None)] * nslices)
15497  *
15498  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15499  *
15500  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15501  */
15502  __Pyx_XDECREF(__pyx_r);
15503  if (!__pyx_v_have_slices) {
15504  } else {
15505  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15506  __Pyx_GOTREF(__pyx_t_4);
15507  __pyx_t_3 = __pyx_t_4;
15508  __pyx_t_4 = 0;
15509  goto __pyx_L14_bool_binop_done;
15510  }
15511  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15512  __Pyx_GOTREF(__pyx_t_4);
15513  __pyx_t_3 = __pyx_t_4;
15514  __pyx_t_4 = 0;
15515  __pyx_L14_bool_binop_done:;
15516  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15517  __Pyx_GOTREF(__pyx_t_4);
15518  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15519  __Pyx_GOTREF(__pyx_t_11);
15520  __Pyx_GIVEREF(__pyx_t_3);
15521  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15522  __Pyx_GIVEREF(__pyx_t_4);
15523  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15524  __pyx_t_3 = 0;
15525  __pyx_t_4 = 0;
15526  __pyx_r = ((PyObject*)__pyx_t_11);
15527  __pyx_t_11 = 0;
15528  goto __pyx_L0;
15529 
15530  /* "View.MemoryView":666
15531  * return isinstance(o, memoryview)
15532  *
15533  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15534  * """
15535  * Replace all ellipses with full slices and fill incomplete indices with
15536  */
15537 
15538  /* function exit code */
15539  __pyx_L1_error:;
15540  __Pyx_XDECREF(__pyx_t_3);
15541  __Pyx_XDECREF(__pyx_t_4);
15542  __Pyx_XDECREF(__pyx_t_7);
15543  __Pyx_XDECREF(__pyx_t_11);
15544  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15545  __pyx_r = 0;
15546  __pyx_L0:;
15547  __Pyx_XDECREF(__pyx_v_tup);
15548  __Pyx_XDECREF(__pyx_v_result);
15549  __Pyx_XDECREF(__pyx_v_idx);
15550  __Pyx_XDECREF(__pyx_v_item);
15551  __Pyx_XGIVEREF(__pyx_r);
15552  __Pyx_TraceReturn(__pyx_r, 0);
15553  __Pyx_RefNannyFinishContext();
15554  return __pyx_r;
15555 }
15556 
15557 /* "View.MemoryView":700
15558  * return have_slices or nslices, tuple(result)
15559  *
15560  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15561  * for suboffset in suboffsets[:ndim]:
15562  * if suboffset >= 0:
15563  */
15564 
15565 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15566  Py_ssize_t __pyx_v_suboffset;
15567  PyObject *__pyx_r = NULL;
15568  __Pyx_TraceDeclarations
15569  __Pyx_RefNannyDeclarations
15570  Py_ssize_t *__pyx_t_1;
15571  Py_ssize_t *__pyx_t_2;
15572  Py_ssize_t *__pyx_t_3;
15573  int __pyx_t_4;
15574  PyObject *__pyx_t_5 = NULL;
15575  int __pyx_lineno = 0;
15576  const char *__pyx_filename = NULL;
15577  int __pyx_clineno = 0;
15578  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15579  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15580 
15581  /* "View.MemoryView":701
15582  *
15583  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15584  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15585  * if suboffset >= 0:
15586  * raise ValueError("Indirect dimensions not supported")
15587  */
15588  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15589  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15590  __pyx_t_1 = __pyx_t_3;
15591  __pyx_v_suboffset = (__pyx_t_1[0]);
15592 
15593  /* "View.MemoryView":702
15594  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15595  * for suboffset in suboffsets[:ndim]:
15596  * if suboffset >= 0: # <<<<<<<<<<<<<<
15597  * raise ValueError("Indirect dimensions not supported")
15598  *
15599  */
15600  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15601  if (unlikely(__pyx_t_4)) {
15602 
15603  /* "View.MemoryView":703
15604  * for suboffset in suboffsets[:ndim]:
15605  * if suboffset >= 0:
15606  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15607  *
15608  *
15609  */
15610  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15611  __Pyx_GOTREF(__pyx_t_5);
15612  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15613  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15614  __PYX_ERR(1, 703, __pyx_L1_error)
15615 
15616  /* "View.MemoryView":702
15617  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15618  * for suboffset in suboffsets[:ndim]:
15619  * if suboffset >= 0: # <<<<<<<<<<<<<<
15620  * raise ValueError("Indirect dimensions not supported")
15621  *
15622  */
15623  }
15624  }
15625 
15626  /* "View.MemoryView":700
15627  * return have_slices or nslices, tuple(result)
15628  *
15629  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15630  * for suboffset in suboffsets[:ndim]:
15631  * if suboffset >= 0:
15632  */
15633 
15634  /* function exit code */
15635  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15636  goto __pyx_L0;
15637  __pyx_L1_error:;
15638  __Pyx_XDECREF(__pyx_t_5);
15639  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15640  __pyx_r = 0;
15641  __pyx_L0:;
15642  __Pyx_XGIVEREF(__pyx_r);
15643  __Pyx_TraceReturn(__pyx_r, 0);
15644  __Pyx_RefNannyFinishContext();
15645  return __pyx_r;
15646 }
15647 
15648 /* "View.MemoryView":710
15649  *
15650  * @cname('__pyx_memview_slice')
15651  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15652  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15653  * cdef bint negative_step
15654  */
15655 
15656 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15657  int __pyx_v_new_ndim;
15658  int __pyx_v_suboffset_dim;
15659  int __pyx_v_dim;
15660  __Pyx_memviewslice __pyx_v_src;
15661  __Pyx_memviewslice __pyx_v_dst;
15662  __Pyx_memviewslice *__pyx_v_p_src;
15663  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15664  __Pyx_memviewslice *__pyx_v_p_dst;
15665  int *__pyx_v_p_suboffset_dim;
15666  Py_ssize_t __pyx_v_start;
15667  Py_ssize_t __pyx_v_stop;
15668  Py_ssize_t __pyx_v_step;
15669  int __pyx_v_have_start;
15670  int __pyx_v_have_stop;
15671  int __pyx_v_have_step;
15672  PyObject *__pyx_v_index = NULL;
15673  struct __pyx_memoryview_obj *__pyx_r = NULL;
15674  __Pyx_TraceDeclarations
15675  __Pyx_RefNannyDeclarations
15676  int __pyx_t_1;
15677  int __pyx_t_2;
15678  PyObject *__pyx_t_3 = NULL;
15679  struct __pyx_memoryview_obj *__pyx_t_4;
15680  char *__pyx_t_5;
15681  int __pyx_t_6;
15682  Py_ssize_t __pyx_t_7;
15683  PyObject *(*__pyx_t_8)(PyObject *);
15684  PyObject *__pyx_t_9 = NULL;
15685  Py_ssize_t __pyx_t_10;
15686  int __pyx_t_11;
15687  Py_ssize_t __pyx_t_12;
15688  int __pyx_lineno = 0;
15689  const char *__pyx_filename = NULL;
15690  int __pyx_clineno = 0;
15691  __Pyx_RefNannySetupContext("memview_slice", 0);
15692  __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15693 
15694  /* "View.MemoryView":711
15695  * @cname('__pyx_memview_slice')
15696  * cdef memoryview memview_slice(memoryview memview, object indices):
15697  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15698  * cdef bint negative_step
15699  * cdef __Pyx_memviewslice src, dst
15700  */
15701  __pyx_v_new_ndim = 0;
15702  __pyx_v_suboffset_dim = -1;
15703 
15704  /* "View.MemoryView":718
15705  *
15706  *
15707  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15708  *
15709  * cdef _memoryviewslice memviewsliceobj
15710  */
15711  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15712 
15713  /* "View.MemoryView":722
15714  * cdef _memoryviewslice memviewsliceobj
15715  *
15716  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15717  *
15718  * if isinstance(memview, _memoryviewslice):
15719  */
15720  #ifndef CYTHON_WITHOUT_ASSERTIONS
15721  if (unlikely(!Py_OptimizeFlag)) {
15722  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15723  PyErr_SetNone(PyExc_AssertionError);
15724  __PYX_ERR(1, 722, __pyx_L1_error)
15725  }
15726  }
15727  #endif
15728 
15729  /* "View.MemoryView":724
15730  * assert memview.view.ndim > 0
15731  *
15732  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15733  * memviewsliceobj = memview
15734  * p_src = &memviewsliceobj.from_slice
15735  */
15736  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15737  __pyx_t_2 = (__pyx_t_1 != 0);
15738  if (__pyx_t_2) {
15739 
15740  /* "View.MemoryView":725
15741  *
15742  * if isinstance(memview, _memoryviewslice):
15743  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15744  * p_src = &memviewsliceobj.from_slice
15745  * else:
15746  */
15747  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15748  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15749  __Pyx_INCREF(__pyx_t_3);
15750  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15751  __pyx_t_3 = 0;
15752 
15753  /* "View.MemoryView":726
15754  * if isinstance(memview, _memoryviewslice):
15755  * memviewsliceobj = memview
15756  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15757  * else:
15758  * slice_copy(memview, &src)
15759  */
15760  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15761 
15762  /* "View.MemoryView":724
15763  * assert memview.view.ndim > 0
15764  *
15765  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15766  * memviewsliceobj = memview
15767  * p_src = &memviewsliceobj.from_slice
15768  */
15769  goto __pyx_L3;
15770  }
15771 
15772  /* "View.MemoryView":728
15773  * p_src = &memviewsliceobj.from_slice
15774  * else:
15775  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15776  * p_src = &src
15777  *
15778  */
15779  /*else*/ {
15780  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15781 
15782  /* "View.MemoryView":729
15783  * else:
15784  * slice_copy(memview, &src)
15785  * p_src = &src # <<<<<<<<<<<<<<
15786  *
15787  *
15788  */
15789  __pyx_v_p_src = (&__pyx_v_src);
15790  }
15791  __pyx_L3:;
15792 
15793  /* "View.MemoryView":735
15794  *
15795  *
15796  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15797  * dst.data = p_src.data
15798  *
15799  */
15800  __pyx_t_4 = __pyx_v_p_src->memview;
15801  __pyx_v_dst.memview = __pyx_t_4;
15802 
15803  /* "View.MemoryView":736
15804  *
15805  * dst.memview = p_src.memview
15806  * dst.data = p_src.data # <<<<<<<<<<<<<<
15807  *
15808  *
15809  */
15810  __pyx_t_5 = __pyx_v_p_src->data;
15811  __pyx_v_dst.data = __pyx_t_5;
15812 
15813  /* "View.MemoryView":741
15814  *
15815  *
15816  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15817  * cdef int *p_suboffset_dim = &suboffset_dim
15818  * cdef Py_ssize_t start, stop, step
15819  */
15820  __pyx_v_p_dst = (&__pyx_v_dst);
15821 
15822  /* "View.MemoryView":742
15823  *
15824  * cdef __Pyx_memviewslice *p_dst = &dst
15825  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15826  * cdef Py_ssize_t start, stop, step
15827  * cdef bint have_start, have_stop, have_step
15828  */
15829  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15830 
15831  /* "View.MemoryView":746
15832  * cdef bint have_start, have_stop, have_step
15833  *
15834  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15835  * if PyIndex_Check(index):
15836  * slice_memviewslice(
15837  */
15838  __pyx_t_6 = 0;
15839  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15840  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15841  __pyx_t_8 = NULL;
15842  } else {
15843  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15844  __Pyx_GOTREF(__pyx_t_3);
15845  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15846  }
15847  for (;;) {
15848  if (likely(!__pyx_t_8)) {
15849  if (likely(PyList_CheckExact(__pyx_t_3))) {
15850  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15851  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15852  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15853  #else
15854  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15855  __Pyx_GOTREF(__pyx_t_9);
15856  #endif
15857  } else {
15858  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15859  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15860  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15861  #else
15862  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15863  __Pyx_GOTREF(__pyx_t_9);
15864  #endif
15865  }
15866  } else {
15867  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15868  if (unlikely(!__pyx_t_9)) {
15869  PyObject* exc_type = PyErr_Occurred();
15870  if (exc_type) {
15871  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15872  else __PYX_ERR(1, 746, __pyx_L1_error)
15873  }
15874  break;
15875  }
15876  __Pyx_GOTREF(__pyx_t_9);
15877  }
15878  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15879  __pyx_t_9 = 0;
15880  __pyx_v_dim = __pyx_t_6;
15881  __pyx_t_6 = (__pyx_t_6 + 1);
15882 
15883  /* "View.MemoryView":747
15884  *
15885  * for dim, index in enumerate(indices):
15886  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15887  * slice_memviewslice(
15888  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15889  */
15890  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15891  if (__pyx_t_2) {
15892 
15893  /* "View.MemoryView":751
15894  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15895  * dim, new_ndim, p_suboffset_dim,
15896  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15897  * 0, 0, 0, # have_{start,stop,step}
15898  * False)
15899  */
15900  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15901 
15902  /* "View.MemoryView":748
15903  * for dim, index in enumerate(indices):
15904  * if PyIndex_Check(index):
15905  * slice_memviewslice( # <<<<<<<<<<<<<<
15906  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15907  * dim, new_ndim, p_suboffset_dim,
15908  */
15909  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15910 
15911  /* "View.MemoryView":747
15912  *
15913  * for dim, index in enumerate(indices):
15914  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15915  * slice_memviewslice(
15916  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15917  */
15918  goto __pyx_L6;
15919  }
15920 
15921  /* "View.MemoryView":754
15922  * 0, 0, 0, # have_{start,stop,step}
15923  * False)
15924  * elif index is None: # <<<<<<<<<<<<<<
15925  * p_dst.shape[new_ndim] = 1
15926  * p_dst.strides[new_ndim] = 0
15927  */
15928  __pyx_t_2 = (__pyx_v_index == Py_None);
15929  __pyx_t_1 = (__pyx_t_2 != 0);
15930  if (__pyx_t_1) {
15931 
15932  /* "View.MemoryView":755
15933  * False)
15934  * elif index is None:
15935  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15936  * p_dst.strides[new_ndim] = 0
15937  * p_dst.suboffsets[new_ndim] = -1
15938  */
15939  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15940 
15941  /* "View.MemoryView":756
15942  * elif index is None:
15943  * p_dst.shape[new_ndim] = 1
15944  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15945  * p_dst.suboffsets[new_ndim] = -1
15946  * new_ndim += 1
15947  */
15948  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15949 
15950  /* "View.MemoryView":757
15951  * p_dst.shape[new_ndim] = 1
15952  * p_dst.strides[new_ndim] = 0
15953  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15954  * new_ndim += 1
15955  * else:
15956  */
15957  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15958 
15959  /* "View.MemoryView":758
15960  * p_dst.strides[new_ndim] = 0
15961  * p_dst.suboffsets[new_ndim] = -1
15962  * new_ndim += 1 # <<<<<<<<<<<<<<
15963  * else:
15964  * start = index.start or 0
15965  */
15966  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15967 
15968  /* "View.MemoryView":754
15969  * 0, 0, 0, # have_{start,stop,step}
15970  * False)
15971  * elif index is None: # <<<<<<<<<<<<<<
15972  * p_dst.shape[new_ndim] = 1
15973  * p_dst.strides[new_ndim] = 0
15974  */
15975  goto __pyx_L6;
15976  }
15977 
15978  /* "View.MemoryView":760
15979  * new_ndim += 1
15980  * else:
15981  * start = index.start or 0 # <<<<<<<<<<<<<<
15982  * stop = index.stop or 0
15983  * step = index.step or 0
15984  */
15985  /*else*/ {
15986  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15987  __Pyx_GOTREF(__pyx_t_9);
15988  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15989  if (!__pyx_t_1) {
15990  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15991  } else {
15992  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15993  __pyx_t_10 = __pyx_t_12;
15994  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15995  goto __pyx_L7_bool_binop_done;
15996  }
15997  __pyx_t_10 = 0;
15998  __pyx_L7_bool_binop_done:;
15999  __pyx_v_start = __pyx_t_10;
16000 
16001  /* "View.MemoryView":761
16002  * else:
16003  * start = index.start or 0
16004  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16005  * step = index.step or 0
16006  *
16007  */
16008  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16009  __Pyx_GOTREF(__pyx_t_9);
16010  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16011  if (!__pyx_t_1) {
16012  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16013  } else {
16014  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16015  __pyx_t_10 = __pyx_t_12;
16016  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16017  goto __pyx_L9_bool_binop_done;
16018  }
16019  __pyx_t_10 = 0;
16020  __pyx_L9_bool_binop_done:;
16021  __pyx_v_stop = __pyx_t_10;
16022 
16023  /* "View.MemoryView":762
16024  * start = index.start or 0
16025  * stop = index.stop or 0
16026  * step = index.step or 0 # <<<<<<<<<<<<<<
16027  *
16028  * have_start = index.start is not None
16029  */
16030  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16031  __Pyx_GOTREF(__pyx_t_9);
16032  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16033  if (!__pyx_t_1) {
16034  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16035  } else {
16036  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16037  __pyx_t_10 = __pyx_t_12;
16038  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16039  goto __pyx_L11_bool_binop_done;
16040  }
16041  __pyx_t_10 = 0;
16042  __pyx_L11_bool_binop_done:;
16043  __pyx_v_step = __pyx_t_10;
16044 
16045  /* "View.MemoryView":764
16046  * step = index.step or 0
16047  *
16048  * have_start = index.start is not None # <<<<<<<<<<<<<<
16049  * have_stop = index.stop is not None
16050  * have_step = index.step is not None
16051  */
16052  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16053  __Pyx_GOTREF(__pyx_t_9);
16054  __pyx_t_1 = (__pyx_t_9 != Py_None);
16055  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16056  __pyx_v_have_start = __pyx_t_1;
16057 
16058  /* "View.MemoryView":765
16059  *
16060  * have_start = index.start is not None
16061  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16062  * have_step = index.step is not None
16063  *
16064  */
16065  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16066  __Pyx_GOTREF(__pyx_t_9);
16067  __pyx_t_1 = (__pyx_t_9 != Py_None);
16068  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16069  __pyx_v_have_stop = __pyx_t_1;
16070 
16071  /* "View.MemoryView":766
16072  * have_start = index.start is not None
16073  * have_stop = index.stop is not None
16074  * have_step = index.step is not None # <<<<<<<<<<<<<<
16075  *
16076  * slice_memviewslice(
16077  */
16078  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16079  __Pyx_GOTREF(__pyx_t_9);
16080  __pyx_t_1 = (__pyx_t_9 != Py_None);
16081  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16082  __pyx_v_have_step = __pyx_t_1;
16083 
16084  /* "View.MemoryView":768
16085  * have_step = index.step is not None
16086  *
16087  * slice_memviewslice( # <<<<<<<<<<<<<<
16088  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16089  * dim, new_ndim, p_suboffset_dim,
16090  */
16091  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16092 
16093  /* "View.MemoryView":774
16094  * have_start, have_stop, have_step,
16095  * True)
16096  * new_ndim += 1 # <<<<<<<<<<<<<<
16097  *
16098  * if isinstance(memview, _memoryviewslice):
16099  */
16100  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16101  }
16102  __pyx_L6:;
16103 
16104  /* "View.MemoryView":746
16105  * cdef bint have_start, have_stop, have_step
16106  *
16107  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16108  * if PyIndex_Check(index):
16109  * slice_memviewslice(
16110  */
16111  }
16112  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16113 
16114  /* "View.MemoryView":776
16115  * new_ndim += 1
16116  *
16117  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16118  * return memoryview_fromslice(dst, new_ndim,
16119  * memviewsliceobj.to_object_func,
16120  */
16121  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16122  __pyx_t_2 = (__pyx_t_1 != 0);
16123  if (__pyx_t_2) {
16124 
16125  /* "View.MemoryView":777
16126  *
16127  * if isinstance(memview, _memoryviewslice):
16128  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16129  * memviewsliceobj.to_object_func,
16130  * memviewsliceobj.to_dtype_func,
16131  */
16132  __Pyx_XDECREF(((PyObject *)__pyx_r));
16133 
16134  /* "View.MemoryView":778
16135  * if isinstance(memview, _memoryviewslice):
16136  * return memoryview_fromslice(dst, new_ndim,
16137  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16138  * memviewsliceobj.to_dtype_func,
16139  * memview.dtype_is_object)
16140  */
16141  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16142 
16143  /* "View.MemoryView":779
16144  * return memoryview_fromslice(dst, new_ndim,
16145  * memviewsliceobj.to_object_func,
16146  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16147  * memview.dtype_is_object)
16148  * else:
16149  */
16150  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16151 
16152  /* "View.MemoryView":777
16153  *
16154  * if isinstance(memview, _memoryviewslice):
16155  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16156  * memviewsliceobj.to_object_func,
16157  * memviewsliceobj.to_dtype_func,
16158  */
16159  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16160  __Pyx_GOTREF(__pyx_t_3);
16161  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16162  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16163  __pyx_t_3 = 0;
16164  goto __pyx_L0;
16165 
16166  /* "View.MemoryView":776
16167  * new_ndim += 1
16168  *
16169  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16170  * return memoryview_fromslice(dst, new_ndim,
16171  * memviewsliceobj.to_object_func,
16172  */
16173  }
16174 
16175  /* "View.MemoryView":782
16176  * memview.dtype_is_object)
16177  * else:
16178  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16179  * memview.dtype_is_object)
16180  *
16181  */
16182  /*else*/ {
16183  __Pyx_XDECREF(((PyObject *)__pyx_r));
16184 
16185  /* "View.MemoryView":783
16186  * else:
16187  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16188  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16189  *
16190  *
16191  */
16192  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16193  __Pyx_GOTREF(__pyx_t_3);
16194 
16195  /* "View.MemoryView":782
16196  * memview.dtype_is_object)
16197  * else:
16198  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16199  * memview.dtype_is_object)
16200  *
16201  */
16202  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16203  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16204  __pyx_t_3 = 0;
16205  goto __pyx_L0;
16206  }
16207 
16208  /* "View.MemoryView":710
16209  *
16210  * @cname('__pyx_memview_slice')
16211  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16212  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16213  * cdef bint negative_step
16214  */
16215 
16216  /* function exit code */
16217  __pyx_L1_error:;
16218  __Pyx_XDECREF(__pyx_t_3);
16219  __Pyx_XDECREF(__pyx_t_9);
16220  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16221  __pyx_r = 0;
16222  __pyx_L0:;
16223  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16224  __Pyx_XDECREF(__pyx_v_index);
16225  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16226  __Pyx_TraceReturn(__pyx_r, 0);
16227  __Pyx_RefNannyFinishContext();
16228  return __pyx_r;
16229 }
16230 
16231 /* "View.MemoryView":807
16232  *
16233  * @cname('__pyx_memoryview_slice_memviewslice')
16234  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16235  * __Pyx_memviewslice *dst,
16236  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16237  */
16238 
16239 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16240  Py_ssize_t __pyx_v_new_shape;
16241  int __pyx_v_negative_step;
16242  int __pyx_r;
16243  __Pyx_TraceDeclarations
16244  int __pyx_t_1;
16245  int __pyx_t_2;
16246  int __pyx_t_3;
16247  int __pyx_lineno = 0;
16248  const char *__pyx_filename = NULL;
16249  int __pyx_clineno = 0;
16250  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
16251 
16252  /* "View.MemoryView":827
16253  * cdef bint negative_step
16254  *
16255  * if not is_slice: # <<<<<<<<<<<<<<
16256  *
16257  * if start < 0:
16258  */
16259  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16260  if (__pyx_t_1) {
16261 
16262  /* "View.MemoryView":829
16263  * if not is_slice:
16264  *
16265  * if start < 0: # <<<<<<<<<<<<<<
16266  * start += shape
16267  * if not 0 <= start < shape:
16268  */
16269  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16270  if (__pyx_t_1) {
16271 
16272  /* "View.MemoryView":830
16273  *
16274  * if start < 0:
16275  * start += shape # <<<<<<<<<<<<<<
16276  * if not 0 <= start < shape:
16277  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16278  */
16279  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16280 
16281  /* "View.MemoryView":829
16282  * if not is_slice:
16283  *
16284  * if start < 0: # <<<<<<<<<<<<<<
16285  * start += shape
16286  * if not 0 <= start < shape:
16287  */
16288  }
16289 
16290  /* "View.MemoryView":831
16291  * if start < 0:
16292  * start += shape
16293  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16294  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16295  * else:
16296  */
16297  __pyx_t_1 = (0 <= __pyx_v_start);
16298  if (__pyx_t_1) {
16299  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16300  }
16301  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16302  if (__pyx_t_2) {
16303 
16304  /* "View.MemoryView":832
16305  * start += shape
16306  * if not 0 <= start < shape:
16307  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16308  * else:
16309  *
16310  */
16311  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16312 
16313  /* "View.MemoryView":831
16314  * if start < 0:
16315  * start += shape
16316  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16317  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16318  * else:
16319  */
16320  }
16321 
16322  /* "View.MemoryView":827
16323  * cdef bint negative_step
16324  *
16325  * if not is_slice: # <<<<<<<<<<<<<<
16326  *
16327  * if start < 0:
16328  */
16329  goto __pyx_L3;
16330  }
16331 
16332  /* "View.MemoryView":835
16333  * else:
16334  *
16335  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16336  *
16337  * if have_step and step == 0:
16338  */
16339  /*else*/ {
16340  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16341  if (__pyx_t_1) {
16342  } else {
16343  __pyx_t_2 = __pyx_t_1;
16344  goto __pyx_L6_bool_binop_done;
16345  }
16346  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16347  __pyx_t_2 = __pyx_t_1;
16348  __pyx_L6_bool_binop_done:;
16349  __pyx_v_negative_step = __pyx_t_2;
16350 
16351  /* "View.MemoryView":837
16352  * negative_step = have_step != 0 and step < 0
16353  *
16354  * if have_step and step == 0: # <<<<<<<<<<<<<<
16355  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16356  *
16357  */
16358  __pyx_t_1 = (__pyx_v_have_step != 0);
16359  if (__pyx_t_1) {
16360  } else {
16361  __pyx_t_2 = __pyx_t_1;
16362  goto __pyx_L9_bool_binop_done;
16363  }
16364  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16365  __pyx_t_2 = __pyx_t_1;
16366  __pyx_L9_bool_binop_done:;
16367  if (__pyx_t_2) {
16368 
16369  /* "View.MemoryView":838
16370  *
16371  * if have_step and step == 0:
16372  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16373  *
16374  *
16375  */
16376  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16377 
16378  /* "View.MemoryView":837
16379  * negative_step = have_step != 0 and step < 0
16380  *
16381  * if have_step and step == 0: # <<<<<<<<<<<<<<
16382  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16383  *
16384  */
16385  }
16386 
16387  /* "View.MemoryView":841
16388  *
16389  *
16390  * if have_start: # <<<<<<<<<<<<<<
16391  * if start < 0:
16392  * start += shape
16393  */
16394  __pyx_t_2 = (__pyx_v_have_start != 0);
16395  if (__pyx_t_2) {
16396 
16397  /* "View.MemoryView":842
16398  *
16399  * if have_start:
16400  * if start < 0: # <<<<<<<<<<<<<<
16401  * start += shape
16402  * if start < 0:
16403  */
16404  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16405  if (__pyx_t_2) {
16406 
16407  /* "View.MemoryView":843
16408  * if have_start:
16409  * if start < 0:
16410  * start += shape # <<<<<<<<<<<<<<
16411  * if start < 0:
16412  * start = 0
16413  */
16414  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16415 
16416  /* "View.MemoryView":844
16417  * if start < 0:
16418  * start += shape
16419  * if start < 0: # <<<<<<<<<<<<<<
16420  * start = 0
16421  * elif start >= shape:
16422  */
16423  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16424  if (__pyx_t_2) {
16425 
16426  /* "View.MemoryView":845
16427  * start += shape
16428  * if start < 0:
16429  * start = 0 # <<<<<<<<<<<<<<
16430  * elif start >= shape:
16431  * if negative_step:
16432  */
16433  __pyx_v_start = 0;
16434 
16435  /* "View.MemoryView":844
16436  * if start < 0:
16437  * start += shape
16438  * if start < 0: # <<<<<<<<<<<<<<
16439  * start = 0
16440  * elif start >= shape:
16441  */
16442  }
16443 
16444  /* "View.MemoryView":842
16445  *
16446  * if have_start:
16447  * if start < 0: # <<<<<<<<<<<<<<
16448  * start += shape
16449  * if start < 0:
16450  */
16451  goto __pyx_L12;
16452  }
16453 
16454  /* "View.MemoryView":846
16455  * if start < 0:
16456  * start = 0
16457  * elif start >= shape: # <<<<<<<<<<<<<<
16458  * if negative_step:
16459  * start = shape - 1
16460  */
16461  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16462  if (__pyx_t_2) {
16463 
16464  /* "View.MemoryView":847
16465  * start = 0
16466  * elif start >= shape:
16467  * if negative_step: # <<<<<<<<<<<<<<
16468  * start = shape - 1
16469  * else:
16470  */
16471  __pyx_t_2 = (__pyx_v_negative_step != 0);
16472  if (__pyx_t_2) {
16473 
16474  /* "View.MemoryView":848
16475  * elif start >= shape:
16476  * if negative_step:
16477  * start = shape - 1 # <<<<<<<<<<<<<<
16478  * else:
16479  * start = shape
16480  */
16481  __pyx_v_start = (__pyx_v_shape - 1);
16482 
16483  /* "View.MemoryView":847
16484  * start = 0
16485  * elif start >= shape:
16486  * if negative_step: # <<<<<<<<<<<<<<
16487  * start = shape - 1
16488  * else:
16489  */
16490  goto __pyx_L14;
16491  }
16492 
16493  /* "View.MemoryView":850
16494  * start = shape - 1
16495  * else:
16496  * start = shape # <<<<<<<<<<<<<<
16497  * else:
16498  * if negative_step:
16499  */
16500  /*else*/ {
16501  __pyx_v_start = __pyx_v_shape;
16502  }
16503  __pyx_L14:;
16504 
16505  /* "View.MemoryView":846
16506  * if start < 0:
16507  * start = 0
16508  * elif start >= shape: # <<<<<<<<<<<<<<
16509  * if negative_step:
16510  * start = shape - 1
16511  */
16512  }
16513  __pyx_L12:;
16514 
16515  /* "View.MemoryView":841
16516  *
16517  *
16518  * if have_start: # <<<<<<<<<<<<<<
16519  * if start < 0:
16520  * start += shape
16521  */
16522  goto __pyx_L11;
16523  }
16524 
16525  /* "View.MemoryView":852
16526  * start = shape
16527  * else:
16528  * if negative_step: # <<<<<<<<<<<<<<
16529  * start = shape - 1
16530  * else:
16531  */
16532  /*else*/ {
16533  __pyx_t_2 = (__pyx_v_negative_step != 0);
16534  if (__pyx_t_2) {
16535 
16536  /* "View.MemoryView":853
16537  * else:
16538  * if negative_step:
16539  * start = shape - 1 # <<<<<<<<<<<<<<
16540  * else:
16541  * start = 0
16542  */
16543  __pyx_v_start = (__pyx_v_shape - 1);
16544 
16545  /* "View.MemoryView":852
16546  * start = shape
16547  * else:
16548  * if negative_step: # <<<<<<<<<<<<<<
16549  * start = shape - 1
16550  * else:
16551  */
16552  goto __pyx_L15;
16553  }
16554 
16555  /* "View.MemoryView":855
16556  * start = shape - 1
16557  * else:
16558  * start = 0 # <<<<<<<<<<<<<<
16559  *
16560  * if have_stop:
16561  */
16562  /*else*/ {
16563  __pyx_v_start = 0;
16564  }
16565  __pyx_L15:;
16566  }
16567  __pyx_L11:;
16568 
16569  /* "View.MemoryView":857
16570  * start = 0
16571  *
16572  * if have_stop: # <<<<<<<<<<<<<<
16573  * if stop < 0:
16574  * stop += shape
16575  */
16576  __pyx_t_2 = (__pyx_v_have_stop != 0);
16577  if (__pyx_t_2) {
16578 
16579  /* "View.MemoryView":858
16580  *
16581  * if have_stop:
16582  * if stop < 0: # <<<<<<<<<<<<<<
16583  * stop += shape
16584  * if stop < 0:
16585  */
16586  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16587  if (__pyx_t_2) {
16588 
16589  /* "View.MemoryView":859
16590  * if have_stop:
16591  * if stop < 0:
16592  * stop += shape # <<<<<<<<<<<<<<
16593  * if stop < 0:
16594  * stop = 0
16595  */
16596  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16597 
16598  /* "View.MemoryView":860
16599  * if stop < 0:
16600  * stop += shape
16601  * if stop < 0: # <<<<<<<<<<<<<<
16602  * stop = 0
16603  * elif stop > shape:
16604  */
16605  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16606  if (__pyx_t_2) {
16607 
16608  /* "View.MemoryView":861
16609  * stop += shape
16610  * if stop < 0:
16611  * stop = 0 # <<<<<<<<<<<<<<
16612  * elif stop > shape:
16613  * stop = shape
16614  */
16615  __pyx_v_stop = 0;
16616 
16617  /* "View.MemoryView":860
16618  * if stop < 0:
16619  * stop += shape
16620  * if stop < 0: # <<<<<<<<<<<<<<
16621  * stop = 0
16622  * elif stop > shape:
16623  */
16624  }
16625 
16626  /* "View.MemoryView":858
16627  *
16628  * if have_stop:
16629  * if stop < 0: # <<<<<<<<<<<<<<
16630  * stop += shape
16631  * if stop < 0:
16632  */
16633  goto __pyx_L17;
16634  }
16635 
16636  /* "View.MemoryView":862
16637  * if stop < 0:
16638  * stop = 0
16639  * elif stop > shape: # <<<<<<<<<<<<<<
16640  * stop = shape
16641  * else:
16642  */
16643  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16644  if (__pyx_t_2) {
16645 
16646  /* "View.MemoryView":863
16647  * stop = 0
16648  * elif stop > shape:
16649  * stop = shape # <<<<<<<<<<<<<<
16650  * else:
16651  * if negative_step:
16652  */
16653  __pyx_v_stop = __pyx_v_shape;
16654 
16655  /* "View.MemoryView":862
16656  * if stop < 0:
16657  * stop = 0
16658  * elif stop > shape: # <<<<<<<<<<<<<<
16659  * stop = shape
16660  * else:
16661  */
16662  }
16663  __pyx_L17:;
16664 
16665  /* "View.MemoryView":857
16666  * start = 0
16667  *
16668  * if have_stop: # <<<<<<<<<<<<<<
16669  * if stop < 0:
16670  * stop += shape
16671  */
16672  goto __pyx_L16;
16673  }
16674 
16675  /* "View.MemoryView":865
16676  * stop = shape
16677  * else:
16678  * if negative_step: # <<<<<<<<<<<<<<
16679  * stop = -1
16680  * else:
16681  */
16682  /*else*/ {
16683  __pyx_t_2 = (__pyx_v_negative_step != 0);
16684  if (__pyx_t_2) {
16685 
16686  /* "View.MemoryView":866
16687  * else:
16688  * if negative_step:
16689  * stop = -1 # <<<<<<<<<<<<<<
16690  * else:
16691  * stop = shape
16692  */
16693  __pyx_v_stop = -1L;
16694 
16695  /* "View.MemoryView":865
16696  * stop = shape
16697  * else:
16698  * if negative_step: # <<<<<<<<<<<<<<
16699  * stop = -1
16700  * else:
16701  */
16702  goto __pyx_L19;
16703  }
16704 
16705  /* "View.MemoryView":868
16706  * stop = -1
16707  * else:
16708  * stop = shape # <<<<<<<<<<<<<<
16709  *
16710  * if not have_step:
16711  */
16712  /*else*/ {
16713  __pyx_v_stop = __pyx_v_shape;
16714  }
16715  __pyx_L19:;
16716  }
16717  __pyx_L16:;
16718 
16719  /* "View.MemoryView":870
16720  * stop = shape
16721  *
16722  * if not have_step: # <<<<<<<<<<<<<<
16723  * step = 1
16724  *
16725  */
16726  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16727  if (__pyx_t_2) {
16728 
16729  /* "View.MemoryView":871
16730  *
16731  * if not have_step:
16732  * step = 1 # <<<<<<<<<<<<<<
16733  *
16734  *
16735  */
16736  __pyx_v_step = 1;
16737 
16738  /* "View.MemoryView":870
16739  * stop = shape
16740  *
16741  * if not have_step: # <<<<<<<<<<<<<<
16742  * step = 1
16743  *
16744  */
16745  }
16746 
16747  /* "View.MemoryView":875
16748  *
16749  * with cython.cdivision(True):
16750  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16751  *
16752  * if (stop - start) - step * new_shape:
16753  */
16754  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16755 
16756  /* "View.MemoryView":877
16757  * new_shape = (stop - start) // step
16758  *
16759  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16760  * new_shape += 1
16761  *
16762  */
16763  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16764  if (__pyx_t_2) {
16765 
16766  /* "View.MemoryView":878
16767  *
16768  * if (stop - start) - step * new_shape:
16769  * new_shape += 1 # <<<<<<<<<<<<<<
16770  *
16771  * if new_shape < 0:
16772  */
16773  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16774 
16775  /* "View.MemoryView":877
16776  * new_shape = (stop - start) // step
16777  *
16778  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16779  * new_shape += 1
16780  *
16781  */
16782  }
16783 
16784  /* "View.MemoryView":880
16785  * new_shape += 1
16786  *
16787  * if new_shape < 0: # <<<<<<<<<<<<<<
16788  * new_shape = 0
16789  *
16790  */
16791  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16792  if (__pyx_t_2) {
16793 
16794  /* "View.MemoryView":881
16795  *
16796  * if new_shape < 0:
16797  * new_shape = 0 # <<<<<<<<<<<<<<
16798  *
16799  *
16800  */
16801  __pyx_v_new_shape = 0;
16802 
16803  /* "View.MemoryView":880
16804  * new_shape += 1
16805  *
16806  * if new_shape < 0: # <<<<<<<<<<<<<<
16807  * new_shape = 0
16808  *
16809  */
16810  }
16811 
16812  /* "View.MemoryView":884
16813  *
16814  *
16815  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16816  * dst.shape[new_ndim] = new_shape
16817  * dst.suboffsets[new_ndim] = suboffset
16818  */
16819  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16820 
16821  /* "View.MemoryView":885
16822  *
16823  * dst.strides[new_ndim] = stride * step
16824  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16825  * dst.suboffsets[new_ndim] = suboffset
16826  *
16827  */
16828  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16829 
16830  /* "View.MemoryView":886
16831  * dst.strides[new_ndim] = stride * step
16832  * dst.shape[new_ndim] = new_shape
16833  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16834  *
16835  *
16836  */
16837  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16838  }
16839  __pyx_L3:;
16840 
16841  /* "View.MemoryView":889
16842  *
16843  *
16844  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16845  * dst.data += start * stride
16846  * else:
16847  */
16848  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16849  if (__pyx_t_2) {
16850 
16851  /* "View.MemoryView":890
16852  *
16853  * if suboffset_dim[0] < 0:
16854  * dst.data += start * stride # <<<<<<<<<<<<<<
16855  * else:
16856  * dst.suboffsets[suboffset_dim[0]] += start * stride
16857  */
16858  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16859 
16860  /* "View.MemoryView":889
16861  *
16862  *
16863  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16864  * dst.data += start * stride
16865  * else:
16866  */
16867  goto __pyx_L23;
16868  }
16869 
16870  /* "View.MemoryView":892
16871  * dst.data += start * stride
16872  * else:
16873  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16874  *
16875  * if suboffset >= 0:
16876  */
16877  /*else*/ {
16878  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16879  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16880  }
16881  __pyx_L23:;
16882 
16883  /* "View.MemoryView":894
16884  * dst.suboffsets[suboffset_dim[0]] += start * stride
16885  *
16886  * if suboffset >= 0: # <<<<<<<<<<<<<<
16887  * if not is_slice:
16888  * if new_ndim == 0:
16889  */
16890  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16891  if (__pyx_t_2) {
16892 
16893  /* "View.MemoryView":895
16894  *
16895  * if suboffset >= 0:
16896  * if not is_slice: # <<<<<<<<<<<<<<
16897  * if new_ndim == 0:
16898  * dst.data = (<char **> dst.data)[0] + suboffset
16899  */
16900  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16901  if (__pyx_t_2) {
16902 
16903  /* "View.MemoryView":896
16904  * if suboffset >= 0:
16905  * if not is_slice:
16906  * if new_ndim == 0: # <<<<<<<<<<<<<<
16907  * dst.data = (<char **> dst.data)[0] + suboffset
16908  * else:
16909  */
16910  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16911  if (__pyx_t_2) {
16912 
16913  /* "View.MemoryView":897
16914  * if not is_slice:
16915  * if new_ndim == 0:
16916  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16917  * else:
16918  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16919  */
16920  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16921 
16922  /* "View.MemoryView":896
16923  * if suboffset >= 0:
16924  * if not is_slice:
16925  * if new_ndim == 0: # <<<<<<<<<<<<<<
16926  * dst.data = (<char **> dst.data)[0] + suboffset
16927  * else:
16928  */
16929  goto __pyx_L26;
16930  }
16931 
16932  /* "View.MemoryView":899
16933  * dst.data = (<char **> dst.data)[0] + suboffset
16934  * else:
16935  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16936  * "must be indexed and not sliced", dim)
16937  * else:
16938  */
16939  /*else*/ {
16940 
16941  /* "View.MemoryView":900
16942  * else:
16943  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16944  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16945  * else:
16946  * suboffset_dim[0] = new_ndim
16947  */
16948  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16949  }
16950  __pyx_L26:;
16951 
16952  /* "View.MemoryView":895
16953  *
16954  * if suboffset >= 0:
16955  * if not is_slice: # <<<<<<<<<<<<<<
16956  * if new_ndim == 0:
16957  * dst.data = (<char **> dst.data)[0] + suboffset
16958  */
16959  goto __pyx_L25;
16960  }
16961 
16962  /* "View.MemoryView":902
16963  * "must be indexed and not sliced", dim)
16964  * else:
16965  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16966  *
16967  * return 0
16968  */
16969  /*else*/ {
16970  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16971  }
16972  __pyx_L25:;
16973 
16974  /* "View.MemoryView":894
16975  * dst.suboffsets[suboffset_dim[0]] += start * stride
16976  *
16977  * if suboffset >= 0: # <<<<<<<<<<<<<<
16978  * if not is_slice:
16979  * if new_ndim == 0:
16980  */
16981  }
16982 
16983  /* "View.MemoryView":904
16984  * suboffset_dim[0] = new_ndim
16985  *
16986  * return 0 # <<<<<<<<<<<<<<
16987  *
16988  *
16989  */
16990  __pyx_r = 0;
16991  goto __pyx_L0;
16992 
16993  /* "View.MemoryView":807
16994  *
16995  * @cname('__pyx_memoryview_slice_memviewslice')
16996  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16997  * __Pyx_memviewslice *dst,
16998  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16999  */
17000 
17001  /* function exit code */
17002  __pyx_L1_error:;
17003  {
17004  #ifdef WITH_THREAD
17005  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17006  #endif
17007  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17008  #ifdef WITH_THREAD
17009  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17010  #endif
17011  }
17012  __pyx_r = -1;
17013  __pyx_L0:;
17014  __Pyx_TraceReturn(Py_None, 1);
17015  return __pyx_r;
17016 }
17017 
17018 /* "View.MemoryView":910
17019  *
17020  * @cname('__pyx_pybuffer_index')
17021  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17022  * Py_ssize_t dim) except NULL:
17023  * cdef Py_ssize_t shape, stride, suboffset = -1
17024  */
17025 
17026 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17027  Py_ssize_t __pyx_v_shape;
17028  Py_ssize_t __pyx_v_stride;
17029  Py_ssize_t __pyx_v_suboffset;
17030  Py_ssize_t __pyx_v_itemsize;
17031  char *__pyx_v_resultp;
17032  char *__pyx_r;
17033  __Pyx_TraceDeclarations
17034  __Pyx_RefNannyDeclarations
17035  Py_ssize_t __pyx_t_1;
17036  int __pyx_t_2;
17037  PyObject *__pyx_t_3 = NULL;
17038  PyObject *__pyx_t_4 = NULL;
17039  int __pyx_lineno = 0;
17040  const char *__pyx_filename = NULL;
17041  int __pyx_clineno = 0;
17042  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17043  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
17044 
17045  /* "View.MemoryView":912
17046  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17047  * Py_ssize_t dim) except NULL:
17048  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17049  * cdef Py_ssize_t itemsize = view.itemsize
17050  * cdef char *resultp
17051  */
17052  __pyx_v_suboffset = -1L;
17053 
17054  /* "View.MemoryView":913
17055  * Py_ssize_t dim) except NULL:
17056  * cdef Py_ssize_t shape, stride, suboffset = -1
17057  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17058  * cdef char *resultp
17059  *
17060  */
17061  __pyx_t_1 = __pyx_v_view->itemsize;
17062  __pyx_v_itemsize = __pyx_t_1;
17063 
17064  /* "View.MemoryView":916
17065  * cdef char *resultp
17066  *
17067  * if view.ndim == 0: # <<<<<<<<<<<<<<
17068  * shape = view.len / itemsize
17069  * stride = itemsize
17070  */
17071  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17072  if (__pyx_t_2) {
17073 
17074  /* "View.MemoryView":917
17075  *
17076  * if view.ndim == 0:
17077  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17078  * stride = itemsize
17079  * else:
17080  */
17081  if (unlikely(__pyx_v_itemsize == 0)) {
17082  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17083  __PYX_ERR(1, 917, __pyx_L1_error)
17084  }
17085  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17086  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17087  __PYX_ERR(1, 917, __pyx_L1_error)
17088  }
17089  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17090 
17091  /* "View.MemoryView":918
17092  * if view.ndim == 0:
17093  * shape = view.len / itemsize
17094  * stride = itemsize # <<<<<<<<<<<<<<
17095  * else:
17096  * shape = view.shape[dim]
17097  */
17098  __pyx_v_stride = __pyx_v_itemsize;
17099 
17100  /* "View.MemoryView":916
17101  * cdef char *resultp
17102  *
17103  * if view.ndim == 0: # <<<<<<<<<<<<<<
17104  * shape = view.len / itemsize
17105  * stride = itemsize
17106  */
17107  goto __pyx_L3;
17108  }
17109 
17110  /* "View.MemoryView":920
17111  * stride = itemsize
17112  * else:
17113  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17114  * stride = view.strides[dim]
17115  * if view.suboffsets != NULL:
17116  */
17117  /*else*/ {
17118  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17119 
17120  /* "View.MemoryView":921
17121  * else:
17122  * shape = view.shape[dim]
17123  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17124  * if view.suboffsets != NULL:
17125  * suboffset = view.suboffsets[dim]
17126  */
17127  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17128 
17129  /* "View.MemoryView":922
17130  * shape = view.shape[dim]
17131  * stride = view.strides[dim]
17132  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17133  * suboffset = view.suboffsets[dim]
17134  *
17135  */
17136  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17137  if (__pyx_t_2) {
17138 
17139  /* "View.MemoryView":923
17140  * stride = view.strides[dim]
17141  * if view.suboffsets != NULL:
17142  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17143  *
17144  * if index < 0:
17145  */
17146  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17147 
17148  /* "View.MemoryView":922
17149  * shape = view.shape[dim]
17150  * stride = view.strides[dim]
17151  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17152  * suboffset = view.suboffsets[dim]
17153  *
17154  */
17155  }
17156  }
17157  __pyx_L3:;
17158 
17159  /* "View.MemoryView":925
17160  * suboffset = view.suboffsets[dim]
17161  *
17162  * if index < 0: # <<<<<<<<<<<<<<
17163  * index += view.shape[dim]
17164  * if index < 0:
17165  */
17166  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17167  if (__pyx_t_2) {
17168 
17169  /* "View.MemoryView":926
17170  *
17171  * if index < 0:
17172  * index += view.shape[dim] # <<<<<<<<<<<<<<
17173  * if index < 0:
17174  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17175  */
17176  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17177 
17178  /* "View.MemoryView":927
17179  * if index < 0:
17180  * index += view.shape[dim]
17181  * if index < 0: # <<<<<<<<<<<<<<
17182  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17183  *
17184  */
17185  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17186  if (unlikely(__pyx_t_2)) {
17187 
17188  /* "View.MemoryView":928
17189  * index += view.shape[dim]
17190  * if index < 0:
17191  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17192  *
17193  * if index >= shape:
17194  */
17195  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17196  __Pyx_GOTREF(__pyx_t_3);
17197  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17198  __Pyx_GOTREF(__pyx_t_4);
17199  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17200  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17201  __Pyx_GOTREF(__pyx_t_3);
17202  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17203  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17204  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17205  __PYX_ERR(1, 928, __pyx_L1_error)
17206 
17207  /* "View.MemoryView":927
17208  * if index < 0:
17209  * index += view.shape[dim]
17210  * if index < 0: # <<<<<<<<<<<<<<
17211  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17212  *
17213  */
17214  }
17215 
17216  /* "View.MemoryView":925
17217  * suboffset = view.suboffsets[dim]
17218  *
17219  * if index < 0: # <<<<<<<<<<<<<<
17220  * index += view.shape[dim]
17221  * if index < 0:
17222  */
17223  }
17224 
17225  /* "View.MemoryView":930
17226  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17227  *
17228  * if index >= shape: # <<<<<<<<<<<<<<
17229  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17230  *
17231  */
17232  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17233  if (unlikely(__pyx_t_2)) {
17234 
17235  /* "View.MemoryView":931
17236  *
17237  * if index >= shape:
17238  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17239  *
17240  * resultp = bufp + index * stride
17241  */
17242  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17243  __Pyx_GOTREF(__pyx_t_3);
17244  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17245  __Pyx_GOTREF(__pyx_t_4);
17246  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17247  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17248  __Pyx_GOTREF(__pyx_t_3);
17249  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17250  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17252  __PYX_ERR(1, 931, __pyx_L1_error)
17253 
17254  /* "View.MemoryView":930
17255  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17256  *
17257  * if index >= shape: # <<<<<<<<<<<<<<
17258  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17259  *
17260  */
17261  }
17262 
17263  /* "View.MemoryView":933
17264  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17265  *
17266  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17267  * if suboffset >= 0:
17268  * resultp = (<char **> resultp)[0] + suboffset
17269  */
17270  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17271 
17272  /* "View.MemoryView":934
17273  *
17274  * resultp = bufp + index * stride
17275  * if suboffset >= 0: # <<<<<<<<<<<<<<
17276  * resultp = (<char **> resultp)[0] + suboffset
17277  *
17278  */
17279  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17280  if (__pyx_t_2) {
17281 
17282  /* "View.MemoryView":935
17283  * resultp = bufp + index * stride
17284  * if suboffset >= 0:
17285  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17286  *
17287  * return resultp
17288  */
17289  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17290 
17291  /* "View.MemoryView":934
17292  *
17293  * resultp = bufp + index * stride
17294  * if suboffset >= 0: # <<<<<<<<<<<<<<
17295  * resultp = (<char **> resultp)[0] + suboffset
17296  *
17297  */
17298  }
17299 
17300  /* "View.MemoryView":937
17301  * resultp = (<char **> resultp)[0] + suboffset
17302  *
17303  * return resultp # <<<<<<<<<<<<<<
17304  *
17305  *
17306  */
17307  __pyx_r = __pyx_v_resultp;
17308  goto __pyx_L0;
17309 
17310  /* "View.MemoryView":910
17311  *
17312  * @cname('__pyx_pybuffer_index')
17313  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17314  * Py_ssize_t dim) except NULL:
17315  * cdef Py_ssize_t shape, stride, suboffset = -1
17316  */
17317 
17318  /* function exit code */
17319  __pyx_L1_error:;
17320  __Pyx_XDECREF(__pyx_t_3);
17321  __Pyx_XDECREF(__pyx_t_4);
17322  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17323  __pyx_r = NULL;
17324  __pyx_L0:;
17325  __Pyx_TraceReturn(Py_None, 0);
17326  __Pyx_RefNannyFinishContext();
17327  return __pyx_r;
17328 }
17329 
17330 /* "View.MemoryView":943
17331  *
17332  * @cname('__pyx_memslice_transpose')
17333  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17334  * cdef int ndim = memslice.memview.view.ndim
17335  *
17336  */
17337 
17338 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17339  int __pyx_v_ndim;
17340  Py_ssize_t *__pyx_v_shape;
17341  Py_ssize_t *__pyx_v_strides;
17342  int __pyx_v_i;
17343  int __pyx_v_j;
17344  int __pyx_r;
17345  __Pyx_TraceDeclarations
17346  int __pyx_t_1;
17347  Py_ssize_t *__pyx_t_2;
17348  long __pyx_t_3;
17349  long __pyx_t_4;
17350  Py_ssize_t __pyx_t_5;
17351  Py_ssize_t __pyx_t_6;
17352  int __pyx_t_7;
17353  int __pyx_t_8;
17354  int __pyx_t_9;
17355  int __pyx_lineno = 0;
17356  const char *__pyx_filename = NULL;
17357  int __pyx_clineno = 0;
17358  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
17359 
17360  /* "View.MemoryView":944
17361  * @cname('__pyx_memslice_transpose')
17362  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17363  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17364  *
17365  * cdef Py_ssize_t *shape = memslice.shape
17366  */
17367  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17368  __pyx_v_ndim = __pyx_t_1;
17369 
17370  /* "View.MemoryView":946
17371  * cdef int ndim = memslice.memview.view.ndim
17372  *
17373  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17374  * cdef Py_ssize_t *strides = memslice.strides
17375  *
17376  */
17377  __pyx_t_2 = __pyx_v_memslice->shape;
17378  __pyx_v_shape = __pyx_t_2;
17379 
17380  /* "View.MemoryView":947
17381  *
17382  * cdef Py_ssize_t *shape = memslice.shape
17383  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17384  *
17385  *
17386  */
17387  __pyx_t_2 = __pyx_v_memslice->strides;
17388  __pyx_v_strides = __pyx_t_2;
17389 
17390  /* "View.MemoryView":951
17391  *
17392  * cdef int i, j
17393  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17394  * j = ndim - 1 - i
17395  * strides[i], strides[j] = strides[j], strides[i]
17396  */
17397  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17398  __pyx_t_4 = __pyx_t_3;
17399  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17400  __pyx_v_i = __pyx_t_1;
17401 
17402  /* "View.MemoryView":952
17403  * cdef int i, j
17404  * for i in range(ndim / 2):
17405  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17406  * strides[i], strides[j] = strides[j], strides[i]
17407  * shape[i], shape[j] = shape[j], shape[i]
17408  */
17409  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17410 
17411  /* "View.MemoryView":953
17412  * for i in range(ndim / 2):
17413  * j = ndim - 1 - i
17414  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17415  * shape[i], shape[j] = shape[j], shape[i]
17416  *
17417  */
17418  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17419  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17420  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17421  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17422 
17423  /* "View.MemoryView":954
17424  * j = ndim - 1 - i
17425  * strides[i], strides[j] = strides[j], strides[i]
17426  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17427  *
17428  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17429  */
17430  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17431  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17432  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17433  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17434 
17435  /* "View.MemoryView":956
17436  * shape[i], shape[j] = shape[j], shape[i]
17437  *
17438  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17439  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17440  *
17441  */
17442  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17443  if (!__pyx_t_8) {
17444  } else {
17445  __pyx_t_7 = __pyx_t_8;
17446  goto __pyx_L6_bool_binop_done;
17447  }
17448  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17449  __pyx_t_7 = __pyx_t_8;
17450  __pyx_L6_bool_binop_done:;
17451  if (__pyx_t_7) {
17452 
17453  /* "View.MemoryView":957
17454  *
17455  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17456  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17457  *
17458  * return 1
17459  */
17460  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17461 
17462  /* "View.MemoryView":956
17463  * shape[i], shape[j] = shape[j], shape[i]
17464  *
17465  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17466  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17467  *
17468  */
17469  }
17470  }
17471 
17472  /* "View.MemoryView":959
17473  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17474  *
17475  * return 1 # <<<<<<<<<<<<<<
17476  *
17477  *
17478  */
17479  __pyx_r = 1;
17480  goto __pyx_L0;
17481 
17482  /* "View.MemoryView":943
17483  *
17484  * @cname('__pyx_memslice_transpose')
17485  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17486  * cdef int ndim = memslice.memview.view.ndim
17487  *
17488  */
17489 
17490  /* function exit code */
17491  __pyx_L1_error:;
17492  {
17493  #ifdef WITH_THREAD
17494  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17495  #endif
17496  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17497  #ifdef WITH_THREAD
17498  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17499  #endif
17500  }
17501  __pyx_r = 0;
17502  __pyx_L0:;
17503  __Pyx_TraceReturn(Py_None, 1);
17504  return __pyx_r;
17505 }
17506 
17507 /* "View.MemoryView":976
17508  * cdef int (*to_dtype_func)(char *, object) except 0
17509  *
17510  * def __dealloc__(self): # <<<<<<<<<<<<<<
17511  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17512  *
17513  */
17514 
17515 /* Python wrapper */
17516 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17517 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17518  __Pyx_RefNannyDeclarations
17519  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17520  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17521 
17522  /* function exit code */
17523  __Pyx_RefNannyFinishContext();
17524 }
17525 
17526 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17527  __Pyx_TraceDeclarations
17528  __Pyx_RefNannyDeclarations
17529  int __pyx_lineno = 0;
17530  const char *__pyx_filename = NULL;
17531  int __pyx_clineno = 0;
17532  __Pyx_RefNannySetupContext("__dealloc__", 0);
17533  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17534 
17535  /* "View.MemoryView":977
17536  *
17537  * def __dealloc__(self):
17538  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17539  *
17540  * cdef convert_item_to_object(self, char *itemp):
17541  */
17542  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17543 
17544  /* "View.MemoryView":976
17545  * cdef int (*to_dtype_func)(char *, object) except 0
17546  *
17547  * def __dealloc__(self): # <<<<<<<<<<<<<<
17548  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17549  *
17550  */
17551 
17552  /* function exit code */
17553  goto __pyx_L0;
17554  __pyx_L1_error:;
17555  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17556  __pyx_L0:;
17557  __Pyx_TraceReturn(Py_None, 0);
17558  __Pyx_RefNannyFinishContext();
17559 }
17560 
17561 /* "View.MemoryView":979
17562  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17563  *
17564  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17565  * if self.to_object_func != NULL:
17566  * return self.to_object_func(itemp)
17567  */
17568 
17569 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17570  PyObject *__pyx_r = NULL;
17571  __Pyx_TraceDeclarations
17572  __Pyx_RefNannyDeclarations
17573  int __pyx_t_1;
17574  PyObject *__pyx_t_2 = NULL;
17575  int __pyx_lineno = 0;
17576  const char *__pyx_filename = NULL;
17577  int __pyx_clineno = 0;
17578  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17579  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17580 
17581  /* "View.MemoryView":980
17582  *
17583  * cdef convert_item_to_object(self, char *itemp):
17584  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17585  * return self.to_object_func(itemp)
17586  * else:
17587  */
17588  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17589  if (__pyx_t_1) {
17590 
17591  /* "View.MemoryView":981
17592  * cdef convert_item_to_object(self, char *itemp):
17593  * if self.to_object_func != NULL:
17594  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17595  * else:
17596  * return memoryview.convert_item_to_object(self, itemp)
17597  */
17598  __Pyx_XDECREF(__pyx_r);
17599  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17600  __Pyx_GOTREF(__pyx_t_2);
17601  __pyx_r = __pyx_t_2;
17602  __pyx_t_2 = 0;
17603  goto __pyx_L0;
17604 
17605  /* "View.MemoryView":980
17606  *
17607  * cdef convert_item_to_object(self, char *itemp):
17608  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17609  * return self.to_object_func(itemp)
17610  * else:
17611  */
17612  }
17613 
17614  /* "View.MemoryView":983
17615  * return self.to_object_func(itemp)
17616  * else:
17617  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17618  *
17619  * cdef assign_item_from_object(self, char *itemp, object value):
17620  */
17621  /*else*/ {
17622  __Pyx_XDECREF(__pyx_r);
17623  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17624  __Pyx_GOTREF(__pyx_t_2);
17625  __pyx_r = __pyx_t_2;
17626  __pyx_t_2 = 0;
17627  goto __pyx_L0;
17628  }
17629 
17630  /* "View.MemoryView":979
17631  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17632  *
17633  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17634  * if self.to_object_func != NULL:
17635  * return self.to_object_func(itemp)
17636  */
17637 
17638  /* function exit code */
17639  __pyx_L1_error:;
17640  __Pyx_XDECREF(__pyx_t_2);
17641  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17642  __pyx_r = 0;
17643  __pyx_L0:;
17644  __Pyx_XGIVEREF(__pyx_r);
17645  __Pyx_TraceReturn(__pyx_r, 0);
17646  __Pyx_RefNannyFinishContext();
17647  return __pyx_r;
17648 }
17649 
17650 /* "View.MemoryView":985
17651  * return memoryview.convert_item_to_object(self, itemp)
17652  *
17653  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17654  * if self.to_dtype_func != NULL:
17655  * self.to_dtype_func(itemp, value)
17656  */
17657 
17658 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17659  PyObject *__pyx_r = NULL;
17660  __Pyx_TraceDeclarations
17661  __Pyx_RefNannyDeclarations
17662  int __pyx_t_1;
17663  int __pyx_t_2;
17664  PyObject *__pyx_t_3 = NULL;
17665  int __pyx_lineno = 0;
17666  const char *__pyx_filename = NULL;
17667  int __pyx_clineno = 0;
17668  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17669  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17670 
17671  /* "View.MemoryView":986
17672  *
17673  * cdef assign_item_from_object(self, char *itemp, object value):
17674  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17675  * self.to_dtype_func(itemp, value)
17676  * else:
17677  */
17678  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17679  if (__pyx_t_1) {
17680 
17681  /* "View.MemoryView":987
17682  * cdef assign_item_from_object(self, char *itemp, object value):
17683  * if self.to_dtype_func != NULL:
17684  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17685  * else:
17686  * memoryview.assign_item_from_object(self, itemp, value)
17687  */
17688  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17689 
17690  /* "View.MemoryView":986
17691  *
17692  * cdef assign_item_from_object(self, char *itemp, object value):
17693  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17694  * self.to_dtype_func(itemp, value)
17695  * else:
17696  */
17697  goto __pyx_L3;
17698  }
17699 
17700  /* "View.MemoryView":989
17701  * self.to_dtype_func(itemp, value)
17702  * else:
17703  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17704  *
17705  * @property
17706  */
17707  /*else*/ {
17708  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17709  __Pyx_GOTREF(__pyx_t_3);
17710  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17711  }
17712  __pyx_L3:;
17713 
17714  /* "View.MemoryView":985
17715  * return memoryview.convert_item_to_object(self, itemp)
17716  *
17717  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17718  * if self.to_dtype_func != NULL:
17719  * self.to_dtype_func(itemp, value)
17720  */
17721 
17722  /* function exit code */
17723  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17724  goto __pyx_L0;
17725  __pyx_L1_error:;
17726  __Pyx_XDECREF(__pyx_t_3);
17727  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17728  __pyx_r = 0;
17729  __pyx_L0:;
17730  __Pyx_XGIVEREF(__pyx_r);
17731  __Pyx_TraceReturn(__pyx_r, 0);
17732  __Pyx_RefNannyFinishContext();
17733  return __pyx_r;
17734 }
17735 
17736 /* "View.MemoryView":992
17737  *
17738  * @property
17739  * def base(self): # <<<<<<<<<<<<<<
17740  * return self.from_object
17741  *
17742  */
17743 
17744 /* Python wrapper */
17745 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17746 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17747  PyObject *__pyx_r = 0;
17748  __Pyx_RefNannyDeclarations
17749  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17750  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17751 
17752  /* function exit code */
17753  __Pyx_RefNannyFinishContext();
17754  return __pyx_r;
17755 }
17756 
17757 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17758  PyObject *__pyx_r = NULL;
17759  __Pyx_TraceDeclarations
17760  __Pyx_RefNannyDeclarations
17761  int __pyx_lineno = 0;
17762  const char *__pyx_filename = NULL;
17763  int __pyx_clineno = 0;
17764  __Pyx_RefNannySetupContext("__get__", 0);
17765  __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17766 
17767  /* "View.MemoryView":993
17768  * @property
17769  * def base(self):
17770  * return self.from_object # <<<<<<<<<<<<<<
17771  *
17772  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17773  */
17774  __Pyx_XDECREF(__pyx_r);
17775  __Pyx_INCREF(__pyx_v_self->from_object);
17776  __pyx_r = __pyx_v_self->from_object;
17777  goto __pyx_L0;
17778 
17779  /* "View.MemoryView":992
17780  *
17781  * @property
17782  * def base(self): # <<<<<<<<<<<<<<
17783  * return self.from_object
17784  *
17785  */
17786 
17787  /* function exit code */
17788  __pyx_L1_error:;
17789  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17790  __pyx_r = NULL;
17791  __pyx_L0:;
17792  __Pyx_XGIVEREF(__pyx_r);
17793  __Pyx_TraceReturn(__pyx_r, 0);
17794  __Pyx_RefNannyFinishContext();
17795  return __pyx_r;
17796 }
17797 
17798 /* "(tree fragment)":1
17799  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17800  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17801  * def __setstate_cython__(self, __pyx_state):
17802  */
17803 
17804 /* Python wrapper */
17805 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17806 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17807 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17808  PyObject *__pyx_r = 0;
17809  __Pyx_RefNannyDeclarations
17810  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17811  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17812 
17813  /* function exit code */
17814  __Pyx_RefNannyFinishContext();
17815  return __pyx_r;
17816 }
17817 
17818 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17819  PyObject *__pyx_r = NULL;
17820  __Pyx_TraceDeclarations
17821  __Pyx_RefNannyDeclarations
17822  PyObject *__pyx_t_1 = NULL;
17823  int __pyx_lineno = 0;
17824  const char *__pyx_filename = NULL;
17825  int __pyx_clineno = 0;
17826  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17827  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17828 
17829  /* "(tree fragment)":2
17830  * def __reduce_cython__(self):
17831  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17832  * def __setstate_cython__(self, __pyx_state):
17833  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17834  */
17835  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17836  __Pyx_GOTREF(__pyx_t_1);
17837  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17839  __PYX_ERR(1, 2, __pyx_L1_error)
17840 
17841  /* "(tree fragment)":1
17842  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17843  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17844  * def __setstate_cython__(self, __pyx_state):
17845  */
17846 
17847  /* function exit code */
17848  __pyx_L1_error:;
17849  __Pyx_XDECREF(__pyx_t_1);
17850  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17851  __pyx_r = NULL;
17852  __Pyx_XGIVEREF(__pyx_r);
17853  __Pyx_TraceReturn(__pyx_r, 0);
17854  __Pyx_RefNannyFinishContext();
17855  return __pyx_r;
17856 }
17857 
17858 /* "(tree fragment)":3
17859  * def __reduce_cython__(self):
17860  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17861  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17862  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17863  */
17864 
17865 /* Python wrapper */
17866 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17867 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17868 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17869  PyObject *__pyx_r = 0;
17870  __Pyx_RefNannyDeclarations
17871  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17872  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17873 
17874  /* function exit code */
17875  __Pyx_RefNannyFinishContext();
17876  return __pyx_r;
17877 }
17878 
17879 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17880  PyObject *__pyx_r = NULL;
17881  __Pyx_TraceDeclarations
17882  __Pyx_RefNannyDeclarations
17883  PyObject *__pyx_t_1 = NULL;
17884  int __pyx_lineno = 0;
17885  const char *__pyx_filename = NULL;
17886  int __pyx_clineno = 0;
17887  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17888  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17889 
17890  /* "(tree fragment)":4
17891  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17892  * def __setstate_cython__(self, __pyx_state):
17893  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17894  */
17895  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17896  __Pyx_GOTREF(__pyx_t_1);
17897  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17898  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17899  __PYX_ERR(1, 4, __pyx_L1_error)
17900 
17901  /* "(tree fragment)":3
17902  * def __reduce_cython__(self):
17903  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17904  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17905  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17906  */
17907 
17908  /* function exit code */
17909  __pyx_L1_error:;
17910  __Pyx_XDECREF(__pyx_t_1);
17911  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17912  __pyx_r = NULL;
17913  __Pyx_XGIVEREF(__pyx_r);
17914  __Pyx_TraceReturn(__pyx_r, 0);
17915  __Pyx_RefNannyFinishContext();
17916  return __pyx_r;
17917 }
17918 
17919 /* "View.MemoryView":999
17920  *
17921  * @cname('__pyx_memoryview_fromslice')
17922  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17923  * int ndim,
17924  * object (*to_object_func)(char *),
17925  */
17926 
17927 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17928  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17929  Py_ssize_t __pyx_v_suboffset;
17930  PyObject *__pyx_v_length = NULL;
17931  PyObject *__pyx_r = NULL;
17932  __Pyx_TraceDeclarations
17933  __Pyx_RefNannyDeclarations
17934  int __pyx_t_1;
17935  PyObject *__pyx_t_2 = NULL;
17936  PyObject *__pyx_t_3 = NULL;
17937  __Pyx_TypeInfo *__pyx_t_4;
17938  Py_buffer __pyx_t_5;
17939  Py_ssize_t *__pyx_t_6;
17940  Py_ssize_t *__pyx_t_7;
17941  Py_ssize_t *__pyx_t_8;
17942  Py_ssize_t __pyx_t_9;
17943  int __pyx_lineno = 0;
17944  const char *__pyx_filename = NULL;
17945  int __pyx_clineno = 0;
17946  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17947  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17948 
17949  /* "View.MemoryView":1007
17950  * cdef _memoryviewslice result
17951  *
17952  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17953  * return None
17954  *
17955  */
17956  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17957  if (__pyx_t_1) {
17958 
17959  /* "View.MemoryView":1008
17960  *
17961  * if <PyObject *> memviewslice.memview == Py_None:
17962  * return None # <<<<<<<<<<<<<<
17963  *
17964  *
17965  */
17966  __Pyx_XDECREF(__pyx_r);
17967  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17968  goto __pyx_L0;
17969 
17970  /* "View.MemoryView":1007
17971  * cdef _memoryviewslice result
17972  *
17973  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17974  * return None
17975  *
17976  */
17977  }
17978 
17979  /* "View.MemoryView":1013
17980  *
17981  *
17982  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17983  *
17984  * result.from_slice = memviewslice
17985  */
17986  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17987  __Pyx_GOTREF(__pyx_t_2);
17988  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17989  __Pyx_GOTREF(__pyx_t_3);
17990  __Pyx_INCREF(Py_None);
17991  __Pyx_GIVEREF(Py_None);
17992  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17993  __Pyx_INCREF(__pyx_int_0);
17994  __Pyx_GIVEREF(__pyx_int_0);
17995  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17996  __Pyx_GIVEREF(__pyx_t_2);
17997  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17998  __pyx_t_2 = 0;
17999  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18000  __Pyx_GOTREF(__pyx_t_2);
18001  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18002  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18003  __pyx_t_2 = 0;
18004 
18005  /* "View.MemoryView":1015
18006  * result = _memoryviewslice(None, 0, dtype_is_object)
18007  *
18008  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18009  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18010  *
18011  */
18012  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18013 
18014  /* "View.MemoryView":1016
18015  *
18016  * result.from_slice = memviewslice
18017  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18018  *
18019  * result.from_object = (<memoryview> memviewslice.memview).base
18020  */
18021  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18022 
18023  /* "View.MemoryView":1018
18024  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18025  *
18026  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18027  * result.typeinfo = memviewslice.memview.typeinfo
18028  *
18029  */
18030  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18031  __Pyx_GOTREF(__pyx_t_2);
18032  __Pyx_GIVEREF(__pyx_t_2);
18033  __Pyx_GOTREF(__pyx_v_result->from_object);
18034  __Pyx_DECREF(__pyx_v_result->from_object);
18035  __pyx_v_result->from_object = __pyx_t_2;
18036  __pyx_t_2 = 0;
18037 
18038  /* "View.MemoryView":1019
18039  *
18040  * result.from_object = (<memoryview> memviewslice.memview).base
18041  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18042  *
18043  * result.view = memviewslice.memview.view
18044  */
18045  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18046  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18047 
18048  /* "View.MemoryView":1021
18049  * result.typeinfo = memviewslice.memview.typeinfo
18050  *
18051  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18052  * result.view.buf = <void *> memviewslice.data
18053  * result.view.ndim = ndim
18054  */
18055  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18056  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18057 
18058  /* "View.MemoryView":1022
18059  *
18060  * result.view = memviewslice.memview.view
18061  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18062  * result.view.ndim = ndim
18063  * (<__pyx_buffer *> &result.view).obj = Py_None
18064  */
18065  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18066 
18067  /* "View.MemoryView":1023
18068  * result.view = memviewslice.memview.view
18069  * result.view.buf = <void *> memviewslice.data
18070  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18071  * (<__pyx_buffer *> &result.view).obj = Py_None
18072  * Py_INCREF(Py_None)
18073  */
18074  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18075 
18076  /* "View.MemoryView":1024
18077  * result.view.buf = <void *> memviewslice.data
18078  * result.view.ndim = ndim
18079  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18080  * Py_INCREF(Py_None)
18081  *
18082  */
18083  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18084 
18085  /* "View.MemoryView":1025
18086  * result.view.ndim = ndim
18087  * (<__pyx_buffer *> &result.view).obj = Py_None
18088  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18089  *
18090  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18091  */
18092  Py_INCREF(Py_None);
18093 
18094  /* "View.MemoryView":1027
18095  * Py_INCREF(Py_None)
18096  *
18097  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18098  * result.flags = PyBUF_RECORDS
18099  * else:
18100  */
18101  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18102  if (__pyx_t_1) {
18103 
18104  /* "View.MemoryView":1028
18105  *
18106  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18107  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18108  * else:
18109  * result.flags = PyBUF_RECORDS_RO
18110  */
18111  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18112 
18113  /* "View.MemoryView":1027
18114  * Py_INCREF(Py_None)
18115  *
18116  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18117  * result.flags = PyBUF_RECORDS
18118  * else:
18119  */
18120  goto __pyx_L4;
18121  }
18122 
18123  /* "View.MemoryView":1030
18124  * result.flags = PyBUF_RECORDS
18125  * else:
18126  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18127  *
18128  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18129  */
18130  /*else*/ {
18131  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18132  }
18133  __pyx_L4:;
18134 
18135  /* "View.MemoryView":1032
18136  * result.flags = PyBUF_RECORDS_RO
18137  *
18138  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18139  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18140  *
18141  */
18142  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18143 
18144  /* "View.MemoryView":1033
18145  *
18146  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18147  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18148  *
18149  *
18150  */
18151  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18152 
18153  /* "View.MemoryView":1036
18154  *
18155  *
18156  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18157  * for suboffset in result.from_slice.suboffsets[:ndim]:
18158  * if suboffset >= 0:
18159  */
18160  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18161 
18162  /* "View.MemoryView":1037
18163  *
18164  * result.view.suboffsets = NULL
18165  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18166  * if suboffset >= 0:
18167  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18168  */
18169  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18170  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18171  __pyx_t_6 = __pyx_t_8;
18172  __pyx_v_suboffset = (__pyx_t_6[0]);
18173 
18174  /* "View.MemoryView":1038
18175  * result.view.suboffsets = NULL
18176  * for suboffset in result.from_slice.suboffsets[:ndim]:
18177  * if suboffset >= 0: # <<<<<<<<<<<<<<
18178  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18179  * break
18180  */
18181  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18182  if (__pyx_t_1) {
18183 
18184  /* "View.MemoryView":1039
18185  * for suboffset in result.from_slice.suboffsets[:ndim]:
18186  * if suboffset >= 0:
18187  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18188  * break
18189  *
18190  */
18191  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18192 
18193  /* "View.MemoryView":1040
18194  * if suboffset >= 0:
18195  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18196  * break # <<<<<<<<<<<<<<
18197  *
18198  * result.view.len = result.view.itemsize
18199  */
18200  goto __pyx_L6_break;
18201 
18202  /* "View.MemoryView":1038
18203  * result.view.suboffsets = NULL
18204  * for suboffset in result.from_slice.suboffsets[:ndim]:
18205  * if suboffset >= 0: # <<<<<<<<<<<<<<
18206  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18207  * break
18208  */
18209  }
18210  }
18211  __pyx_L6_break:;
18212 
18213  /* "View.MemoryView":1042
18214  * break
18215  *
18216  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18217  * for length in result.view.shape[:ndim]:
18218  * result.view.len *= length
18219  */
18220  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18221  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18222 
18223  /* "View.MemoryView":1043
18224  *
18225  * result.view.len = result.view.itemsize
18226  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18227  * result.view.len *= length
18228  *
18229  */
18230  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18231  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18232  __pyx_t_6 = __pyx_t_8;
18233  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18234  __Pyx_GOTREF(__pyx_t_2);
18235  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18236  __pyx_t_2 = 0;
18237 
18238  /* "View.MemoryView":1044
18239  * result.view.len = result.view.itemsize
18240  * for length in result.view.shape[:ndim]:
18241  * result.view.len *= length # <<<<<<<<<<<<<<
18242  *
18243  * result.to_object_func = to_object_func
18244  */
18245  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18246  __Pyx_GOTREF(__pyx_t_2);
18247  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18248  __Pyx_GOTREF(__pyx_t_3);
18249  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18250  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18252  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18253  }
18254 
18255  /* "View.MemoryView":1046
18256  * result.view.len *= length
18257  *
18258  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18259  * result.to_dtype_func = to_dtype_func
18260  *
18261  */
18262  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18263 
18264  /* "View.MemoryView":1047
18265  *
18266  * result.to_object_func = to_object_func
18267  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18268  *
18269  * return result
18270  */
18271  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18272 
18273  /* "View.MemoryView":1049
18274  * result.to_dtype_func = to_dtype_func
18275  *
18276  * return result # <<<<<<<<<<<<<<
18277  *
18278  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18279  */
18280  __Pyx_XDECREF(__pyx_r);
18281  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18282  __pyx_r = ((PyObject *)__pyx_v_result);
18283  goto __pyx_L0;
18284 
18285  /* "View.MemoryView":999
18286  *
18287  * @cname('__pyx_memoryview_fromslice')
18288  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18289  * int ndim,
18290  * object (*to_object_func)(char *),
18291  */
18292 
18293  /* function exit code */
18294  __pyx_L1_error:;
18295  __Pyx_XDECREF(__pyx_t_2);
18296  __Pyx_XDECREF(__pyx_t_3);
18297  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18298  __pyx_r = 0;
18299  __pyx_L0:;
18300  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18301  __Pyx_XDECREF(__pyx_v_length);
18302  __Pyx_XGIVEREF(__pyx_r);
18303  __Pyx_TraceReturn(__pyx_r, 0);
18304  __Pyx_RefNannyFinishContext();
18305  return __pyx_r;
18306 }
18307 
18308 /* "View.MemoryView":1052
18309  *
18310  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18311  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18312  * __Pyx_memviewslice *mslice) except NULL:
18313  * cdef _memoryviewslice obj
18314  */
18315 
18316 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18317  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18318  __Pyx_memviewslice *__pyx_r;
18319  __Pyx_TraceDeclarations
18320  __Pyx_RefNannyDeclarations
18321  int __pyx_t_1;
18322  int __pyx_t_2;
18323  PyObject *__pyx_t_3 = NULL;
18324  int __pyx_lineno = 0;
18325  const char *__pyx_filename = NULL;
18326  int __pyx_clineno = 0;
18327  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18328  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
18329 
18330  /* "View.MemoryView":1055
18331  * __Pyx_memviewslice *mslice) except NULL:
18332  * cdef _memoryviewslice obj
18333  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18334  * obj = memview
18335  * return &obj.from_slice
18336  */
18337  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18338  __pyx_t_2 = (__pyx_t_1 != 0);
18339  if (__pyx_t_2) {
18340 
18341  /* "View.MemoryView":1056
18342  * cdef _memoryviewslice obj
18343  * if isinstance(memview, _memoryviewslice):
18344  * obj = memview # <<<<<<<<<<<<<<
18345  * return &obj.from_slice
18346  * else:
18347  */
18348  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18349  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18350  __Pyx_INCREF(__pyx_t_3);
18351  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18352  __pyx_t_3 = 0;
18353 
18354  /* "View.MemoryView":1057
18355  * if isinstance(memview, _memoryviewslice):
18356  * obj = memview
18357  * return &obj.from_slice # <<<<<<<<<<<<<<
18358  * else:
18359  * slice_copy(memview, mslice)
18360  */
18361  __pyx_r = (&__pyx_v_obj->from_slice);
18362  goto __pyx_L0;
18363 
18364  /* "View.MemoryView":1055
18365  * __Pyx_memviewslice *mslice) except NULL:
18366  * cdef _memoryviewslice obj
18367  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18368  * obj = memview
18369  * return &obj.from_slice
18370  */
18371  }
18372 
18373  /* "View.MemoryView":1059
18374  * return &obj.from_slice
18375  * else:
18376  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18377  * return mslice
18378  *
18379  */
18380  /*else*/ {
18381  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18382 
18383  /* "View.MemoryView":1060
18384  * else:
18385  * slice_copy(memview, mslice)
18386  * return mslice # <<<<<<<<<<<<<<
18387  *
18388  * @cname('__pyx_memoryview_slice_copy')
18389  */
18390  __pyx_r = __pyx_v_mslice;
18391  goto __pyx_L0;
18392  }
18393 
18394  /* "View.MemoryView":1052
18395  *
18396  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18397  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18398  * __Pyx_memviewslice *mslice) except NULL:
18399  * cdef _memoryviewslice obj
18400  */
18401 
18402  /* function exit code */
18403  __pyx_L1_error:;
18404  __Pyx_XDECREF(__pyx_t_3);
18405  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18406  __pyx_r = NULL;
18407  __pyx_L0:;
18408  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18409  __Pyx_TraceReturn(Py_None, 0);
18410  __Pyx_RefNannyFinishContext();
18411  return __pyx_r;
18412 }
18413 
18414 /* "View.MemoryView":1063
18415  *
18416  * @cname('__pyx_memoryview_slice_copy')
18417  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18418  * cdef int dim
18419  * cdef (Py_ssize_t*) shape, strides, suboffsets
18420  */
18421 
18422 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18423  int __pyx_v_dim;
18424  Py_ssize_t *__pyx_v_shape;
18425  Py_ssize_t *__pyx_v_strides;
18426  Py_ssize_t *__pyx_v_suboffsets;
18427  __Pyx_TraceDeclarations
18428  __Pyx_RefNannyDeclarations
18429  Py_ssize_t *__pyx_t_1;
18430  int __pyx_t_2;
18431  int __pyx_t_3;
18432  int __pyx_t_4;
18433  Py_ssize_t __pyx_t_5;
18434  int __pyx_lineno = 0;
18435  const char *__pyx_filename = NULL;
18436  int __pyx_clineno = 0;
18437  __Pyx_RefNannySetupContext("slice_copy", 0);
18438  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
18439 
18440  /* "View.MemoryView":1067
18441  * cdef (Py_ssize_t*) shape, strides, suboffsets
18442  *
18443  * shape = memview.view.shape # <<<<<<<<<<<<<<
18444  * strides = memview.view.strides
18445  * suboffsets = memview.view.suboffsets
18446  */
18447  __pyx_t_1 = __pyx_v_memview->view.shape;
18448  __pyx_v_shape = __pyx_t_1;
18449 
18450  /* "View.MemoryView":1068
18451  *
18452  * shape = memview.view.shape
18453  * strides = memview.view.strides # <<<<<<<<<<<<<<
18454  * suboffsets = memview.view.suboffsets
18455  *
18456  */
18457  __pyx_t_1 = __pyx_v_memview->view.strides;
18458  __pyx_v_strides = __pyx_t_1;
18459 
18460  /* "View.MemoryView":1069
18461  * shape = memview.view.shape
18462  * strides = memview.view.strides
18463  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18464  *
18465  * dst.memview = <__pyx_memoryview *> memview
18466  */
18467  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18468  __pyx_v_suboffsets = __pyx_t_1;
18469 
18470  /* "View.MemoryView":1071
18471  * suboffsets = memview.view.suboffsets
18472  *
18473  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18474  * dst.data = <char *> memview.view.buf
18475  *
18476  */
18477  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18478 
18479  /* "View.MemoryView":1072
18480  *
18481  * dst.memview = <__pyx_memoryview *> memview
18482  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18483  *
18484  * for dim in range(memview.view.ndim):
18485  */
18486  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18487 
18488  /* "View.MemoryView":1074
18489  * dst.data = <char *> memview.view.buf
18490  *
18491  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18492  * dst.shape[dim] = shape[dim]
18493  * dst.strides[dim] = strides[dim]
18494  */
18495  __pyx_t_2 = __pyx_v_memview->view.ndim;
18496  __pyx_t_3 = __pyx_t_2;
18497  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18498  __pyx_v_dim = __pyx_t_4;
18499 
18500  /* "View.MemoryView":1075
18501  *
18502  * for dim in range(memview.view.ndim):
18503  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18504  * dst.strides[dim] = strides[dim]
18505  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18506  */
18507  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18508 
18509  /* "View.MemoryView":1076
18510  * for dim in range(memview.view.ndim):
18511  * dst.shape[dim] = shape[dim]
18512  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18513  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18514  *
18515  */
18516  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18517 
18518  /* "View.MemoryView":1077
18519  * dst.shape[dim] = shape[dim]
18520  * dst.strides[dim] = strides[dim]
18521  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18522  *
18523  * @cname('__pyx_memoryview_copy_object')
18524  */
18525  if ((__pyx_v_suboffsets != 0)) {
18526  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18527  } else {
18528  __pyx_t_5 = -1L;
18529  }
18530  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18531  }
18532 
18533  /* "View.MemoryView":1063
18534  *
18535  * @cname('__pyx_memoryview_slice_copy')
18536  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18537  * cdef int dim
18538  * cdef (Py_ssize_t*) shape, strides, suboffsets
18539  */
18540 
18541  /* function exit code */
18542  goto __pyx_L0;
18543  __pyx_L1_error:;
18544  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18545  __pyx_L0:;
18546  __Pyx_TraceReturn(Py_None, 0);
18547  __Pyx_RefNannyFinishContext();
18548 }
18549 
18550 /* "View.MemoryView":1080
18551  *
18552  * @cname('__pyx_memoryview_copy_object')
18553  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18554  * "Create a new memoryview object"
18555  * cdef __Pyx_memviewslice memviewslice
18556  */
18557 
18558 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18559  __Pyx_memviewslice __pyx_v_memviewslice;
18560  PyObject *__pyx_r = NULL;
18561  __Pyx_TraceDeclarations
18562  __Pyx_RefNannyDeclarations
18563  PyObject *__pyx_t_1 = NULL;
18564  int __pyx_lineno = 0;
18565  const char *__pyx_filename = NULL;
18566  int __pyx_clineno = 0;
18567  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18568  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18569 
18570  /* "View.MemoryView":1083
18571  * "Create a new memoryview object"
18572  * cdef __Pyx_memviewslice memviewslice
18573  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18574  * return memoryview_copy_from_slice(memview, &memviewslice)
18575  *
18576  */
18577  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18578 
18579  /* "View.MemoryView":1084
18580  * cdef __Pyx_memviewslice memviewslice
18581  * slice_copy(memview, &memviewslice)
18582  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18583  *
18584  * @cname('__pyx_memoryview_copy_object_from_slice')
18585  */
18586  __Pyx_XDECREF(__pyx_r);
18587  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18588  __Pyx_GOTREF(__pyx_t_1);
18589  __pyx_r = __pyx_t_1;
18590  __pyx_t_1 = 0;
18591  goto __pyx_L0;
18592 
18593  /* "View.MemoryView":1080
18594  *
18595  * @cname('__pyx_memoryview_copy_object')
18596  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18597  * "Create a new memoryview object"
18598  * cdef __Pyx_memviewslice memviewslice
18599  */
18600 
18601  /* function exit code */
18602  __pyx_L1_error:;
18603  __Pyx_XDECREF(__pyx_t_1);
18604  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18605  __pyx_r = 0;
18606  __pyx_L0:;
18607  __Pyx_XGIVEREF(__pyx_r);
18608  __Pyx_TraceReturn(__pyx_r, 0);
18609  __Pyx_RefNannyFinishContext();
18610  return __pyx_r;
18611 }
18612 
18613 /* "View.MemoryView":1087
18614  *
18615  * @cname('__pyx_memoryview_copy_object_from_slice')
18616  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18617  * """
18618  * Create a new memoryview object from a given memoryview object and slice.
18619  */
18620 
18621 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18622  PyObject *(*__pyx_v_to_object_func)(char *);
18623  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18624  PyObject *__pyx_r = NULL;
18625  __Pyx_TraceDeclarations
18626  __Pyx_RefNannyDeclarations
18627  int __pyx_t_1;
18628  int __pyx_t_2;
18629  PyObject *(*__pyx_t_3)(char *);
18630  int (*__pyx_t_4)(char *, PyObject *);
18631  PyObject *__pyx_t_5 = NULL;
18632  int __pyx_lineno = 0;
18633  const char *__pyx_filename = NULL;
18634  int __pyx_clineno = 0;
18635  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18636  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18637 
18638  /* "View.MemoryView":1094
18639  * cdef int (*to_dtype_func)(char *, object) except 0
18640  *
18641  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18642  * to_object_func = (<_memoryviewslice> memview).to_object_func
18643  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18644  */
18645  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18646  __pyx_t_2 = (__pyx_t_1 != 0);
18647  if (__pyx_t_2) {
18648 
18649  /* "View.MemoryView":1095
18650  *
18651  * if isinstance(memview, _memoryviewslice):
18652  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18653  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18654  * else:
18655  */
18656  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18657  __pyx_v_to_object_func = __pyx_t_3;
18658 
18659  /* "View.MemoryView":1096
18660  * if isinstance(memview, _memoryviewslice):
18661  * to_object_func = (<_memoryviewslice> memview).to_object_func
18662  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18663  * else:
18664  * to_object_func = NULL
18665  */
18666  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18667  __pyx_v_to_dtype_func = __pyx_t_4;
18668 
18669  /* "View.MemoryView":1094
18670  * cdef int (*to_dtype_func)(char *, object) except 0
18671  *
18672  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18673  * to_object_func = (<_memoryviewslice> memview).to_object_func
18674  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18675  */
18676  goto __pyx_L3;
18677  }
18678 
18679  /* "View.MemoryView":1098
18680  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18681  * else:
18682  * to_object_func = NULL # <<<<<<<<<<<<<<
18683  * to_dtype_func = NULL
18684  *
18685  */
18686  /*else*/ {
18687  __pyx_v_to_object_func = NULL;
18688 
18689  /* "View.MemoryView":1099
18690  * else:
18691  * to_object_func = NULL
18692  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18693  *
18694  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18695  */
18696  __pyx_v_to_dtype_func = NULL;
18697  }
18698  __pyx_L3:;
18699 
18700  /* "View.MemoryView":1101
18701  * to_dtype_func = NULL
18702  *
18703  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18704  * to_object_func, to_dtype_func,
18705  * memview.dtype_is_object)
18706  */
18707  __Pyx_XDECREF(__pyx_r);
18708 
18709  /* "View.MemoryView":1103
18710  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18711  * to_object_func, to_dtype_func,
18712  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18713  *
18714  *
18715  */
18716  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18717  __Pyx_GOTREF(__pyx_t_5);
18718  __pyx_r = __pyx_t_5;
18719  __pyx_t_5 = 0;
18720  goto __pyx_L0;
18721 
18722  /* "View.MemoryView":1087
18723  *
18724  * @cname('__pyx_memoryview_copy_object_from_slice')
18725  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18726  * """
18727  * Create a new memoryview object from a given memoryview object and slice.
18728  */
18729 
18730  /* function exit code */
18731  __pyx_L1_error:;
18732  __Pyx_XDECREF(__pyx_t_5);
18733  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18734  __pyx_r = 0;
18735  __pyx_L0:;
18736  __Pyx_XGIVEREF(__pyx_r);
18737  __Pyx_TraceReturn(__pyx_r, 0);
18738  __Pyx_RefNannyFinishContext();
18739  return __pyx_r;
18740 }
18741 
18742 /* "View.MemoryView":1109
18743  *
18744  *
18745  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18746  * if arg < 0:
18747  * return -arg
18748  */
18749 
18750 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18751  Py_ssize_t __pyx_r;
18752  __Pyx_TraceDeclarations
18753  int __pyx_t_1;
18754  int __pyx_lineno = 0;
18755  const char *__pyx_filename = NULL;
18756  int __pyx_clineno = 0;
18757  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18758 
18759  /* "View.MemoryView":1110
18760  *
18761  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18762  * if arg < 0: # <<<<<<<<<<<<<<
18763  * return -arg
18764  * else:
18765  */
18766  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18767  if (__pyx_t_1) {
18768 
18769  /* "View.MemoryView":1111
18770  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18771  * if arg < 0:
18772  * return -arg # <<<<<<<<<<<<<<
18773  * else:
18774  * return arg
18775  */
18776  __pyx_r = (-__pyx_v_arg);
18777  goto __pyx_L0;
18778 
18779  /* "View.MemoryView":1110
18780  *
18781  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18782  * if arg < 0: # <<<<<<<<<<<<<<
18783  * return -arg
18784  * else:
18785  */
18786  }
18787 
18788  /* "View.MemoryView":1113
18789  * return -arg
18790  * else:
18791  * return arg # <<<<<<<<<<<<<<
18792  *
18793  * @cname('__pyx_get_best_slice_order')
18794  */
18795  /*else*/ {
18796  __pyx_r = __pyx_v_arg;
18797  goto __pyx_L0;
18798  }
18799 
18800  /* "View.MemoryView":1109
18801  *
18802  *
18803  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18804  * if arg < 0:
18805  * return -arg
18806  */
18807 
18808  /* function exit code */
18809  __pyx_L1_error:;
18810  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18811  __pyx_r = 0;
18812  __pyx_L0:;
18813  __Pyx_TraceReturn(Py_None, 1);
18814  return __pyx_r;
18815 }
18816 
18817 /* "View.MemoryView":1116
18818  *
18819  * @cname('__pyx_get_best_slice_order')
18820  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18821  * """
18822  * Figure out the best memory access order for a given slice.
18823  */
18824 
18825 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18826  int __pyx_v_i;
18827  Py_ssize_t __pyx_v_c_stride;
18828  Py_ssize_t __pyx_v_f_stride;
18829  char __pyx_r;
18830  __Pyx_TraceDeclarations
18831  int __pyx_t_1;
18832  int __pyx_t_2;
18833  int __pyx_t_3;
18834  int __pyx_t_4;
18835  int __pyx_lineno = 0;
18836  const char *__pyx_filename = NULL;
18837  int __pyx_clineno = 0;
18838  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18839 
18840  /* "View.MemoryView":1121
18841  * """
18842  * cdef int i
18843  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18844  * cdef Py_ssize_t f_stride = 0
18845  *
18846  */
18847  __pyx_v_c_stride = 0;
18848 
18849  /* "View.MemoryView":1122
18850  * cdef int i
18851  * cdef Py_ssize_t c_stride = 0
18852  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18853  *
18854  * for i in range(ndim - 1, -1, -1):
18855  */
18856  __pyx_v_f_stride = 0;
18857 
18858  /* "View.MemoryView":1124
18859  * cdef Py_ssize_t f_stride = 0
18860  *
18861  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18862  * if mslice.shape[i] > 1:
18863  * c_stride = mslice.strides[i]
18864  */
18865  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18866  __pyx_v_i = __pyx_t_1;
18867 
18868  /* "View.MemoryView":1125
18869  *
18870  * for i in range(ndim - 1, -1, -1):
18871  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18872  * c_stride = mslice.strides[i]
18873  * break
18874  */
18875  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18876  if (__pyx_t_2) {
18877 
18878  /* "View.MemoryView":1126
18879  * for i in range(ndim - 1, -1, -1):
18880  * if mslice.shape[i] > 1:
18881  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18882  * break
18883  *
18884  */
18885  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18886 
18887  /* "View.MemoryView":1127
18888  * if mslice.shape[i] > 1:
18889  * c_stride = mslice.strides[i]
18890  * break # <<<<<<<<<<<<<<
18891  *
18892  * for i in range(ndim):
18893  */
18894  goto __pyx_L4_break;
18895 
18896  /* "View.MemoryView":1125
18897  *
18898  * for i in range(ndim - 1, -1, -1):
18899  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18900  * c_stride = mslice.strides[i]
18901  * break
18902  */
18903  }
18904  }
18905  __pyx_L4_break:;
18906 
18907  /* "View.MemoryView":1129
18908  * break
18909  *
18910  * for i in range(ndim): # <<<<<<<<<<<<<<
18911  * if mslice.shape[i] > 1:
18912  * f_stride = mslice.strides[i]
18913  */
18914  __pyx_t_1 = __pyx_v_ndim;
18915  __pyx_t_3 = __pyx_t_1;
18916  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18917  __pyx_v_i = __pyx_t_4;
18918 
18919  /* "View.MemoryView":1130
18920  *
18921  * for i in range(ndim):
18922  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18923  * f_stride = mslice.strides[i]
18924  * break
18925  */
18926  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18927  if (__pyx_t_2) {
18928 
18929  /* "View.MemoryView":1131
18930  * for i in range(ndim):
18931  * if mslice.shape[i] > 1:
18932  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18933  * break
18934  *
18935  */
18936  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18937 
18938  /* "View.MemoryView":1132
18939  * if mslice.shape[i] > 1:
18940  * f_stride = mslice.strides[i]
18941  * break # <<<<<<<<<<<<<<
18942  *
18943  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18944  */
18945  goto __pyx_L7_break;
18946 
18947  /* "View.MemoryView":1130
18948  *
18949  * for i in range(ndim):
18950  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18951  * f_stride = mslice.strides[i]
18952  * break
18953  */
18954  }
18955  }
18956  __pyx_L7_break:;
18957 
18958  /* "View.MemoryView":1134
18959  * break
18960  *
18961  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18962  * return 'C'
18963  * else:
18964  */
18965  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18966  if (__pyx_t_2) {
18967 
18968  /* "View.MemoryView":1135
18969  *
18970  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18971  * return 'C' # <<<<<<<<<<<<<<
18972  * else:
18973  * return 'F'
18974  */
18975  __pyx_r = 'C';
18976  goto __pyx_L0;
18977 
18978  /* "View.MemoryView":1134
18979  * break
18980  *
18981  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18982  * return 'C'
18983  * else:
18984  */
18985  }
18986 
18987  /* "View.MemoryView":1137
18988  * return 'C'
18989  * else:
18990  * return 'F' # <<<<<<<<<<<<<<
18991  *
18992  * @cython.cdivision(True)
18993  */
18994  /*else*/ {
18995  __pyx_r = 'F';
18996  goto __pyx_L0;
18997  }
18998 
18999  /* "View.MemoryView":1116
19000  *
19001  * @cname('__pyx_get_best_slice_order')
19002  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19003  * """
19004  * Figure out the best memory access order for a given slice.
19005  */
19006 
19007  /* function exit code */
19008  __pyx_L1_error:;
19009  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19010  __pyx_r = 0;
19011  __pyx_L0:;
19012  __Pyx_TraceReturn(Py_None, 1);
19013  return __pyx_r;
19014 }
19015 
19016 /* "View.MemoryView":1140
19017  *
19018  * @cython.cdivision(True)
19019  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19020  * char *dst_data, Py_ssize_t *dst_strides,
19021  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19022  */
19023 
19024 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19025  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19026  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19027  Py_ssize_t __pyx_v_dst_extent;
19028  Py_ssize_t __pyx_v_src_stride;
19029  Py_ssize_t __pyx_v_dst_stride;
19030  int __pyx_t_1;
19031  int __pyx_t_2;
19032  int __pyx_t_3;
19033  Py_ssize_t __pyx_t_4;
19034  Py_ssize_t __pyx_t_5;
19035  Py_ssize_t __pyx_t_6;
19036 
19037  /* "View.MemoryView":1147
19038  *
19039  * cdef Py_ssize_t i
19040  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19041  * cdef Py_ssize_t dst_extent = dst_shape[0]
19042  * cdef Py_ssize_t src_stride = src_strides[0]
19043  */
19044  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19045 
19046  /* "View.MemoryView":1148
19047  * cdef Py_ssize_t i
19048  * cdef Py_ssize_t src_extent = src_shape[0]
19049  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19050  * cdef Py_ssize_t src_stride = src_strides[0]
19051  * cdef Py_ssize_t dst_stride = dst_strides[0]
19052  */
19053  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19054 
19055  /* "View.MemoryView":1149
19056  * cdef Py_ssize_t src_extent = src_shape[0]
19057  * cdef Py_ssize_t dst_extent = dst_shape[0]
19058  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19059  * cdef Py_ssize_t dst_stride = dst_strides[0]
19060  *
19061  */
19062  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19063 
19064  /* "View.MemoryView":1150
19065  * cdef Py_ssize_t dst_extent = dst_shape[0]
19066  * cdef Py_ssize_t src_stride = src_strides[0]
19067  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19068  *
19069  * if ndim == 1:
19070  */
19071  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19072 
19073  /* "View.MemoryView":1152
19074  * cdef Py_ssize_t dst_stride = dst_strides[0]
19075  *
19076  * if ndim == 1: # <<<<<<<<<<<<<<
19077  * if (src_stride > 0 and dst_stride > 0 and
19078  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19079  */
19080  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19081  if (__pyx_t_1) {
19082 
19083  /* "View.MemoryView":1153
19084  *
19085  * if ndim == 1:
19086  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19087  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19088  * memcpy(dst_data, src_data, itemsize * dst_extent)
19089  */
19090  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19091  if (__pyx_t_2) {
19092  } else {
19093  __pyx_t_1 = __pyx_t_2;
19094  goto __pyx_L5_bool_binop_done;
19095  }
19096  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19097  if (__pyx_t_2) {
19098  } else {
19099  __pyx_t_1 = __pyx_t_2;
19100  goto __pyx_L5_bool_binop_done;
19101  }
19102 
19103  /* "View.MemoryView":1154
19104  * if ndim == 1:
19105  * if (src_stride > 0 and dst_stride > 0 and
19106  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19107  * memcpy(dst_data, src_data, itemsize * dst_extent)
19108  * else:
19109  */
19110  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19111  if (__pyx_t_2) {
19112  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19113  }
19114  __pyx_t_3 = (__pyx_t_2 != 0);
19115  __pyx_t_1 = __pyx_t_3;
19116  __pyx_L5_bool_binop_done:;
19117 
19118  /* "View.MemoryView":1153
19119  *
19120  * if ndim == 1:
19121  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19122  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19123  * memcpy(dst_data, src_data, itemsize * dst_extent)
19124  */
19125  if (__pyx_t_1) {
19126 
19127  /* "View.MemoryView":1155
19128  * if (src_stride > 0 and dst_stride > 0 and
19129  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19130  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19131  * else:
19132  * for i in range(dst_extent):
19133  */
19134  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19135 
19136  /* "View.MemoryView":1153
19137  *
19138  * if ndim == 1:
19139  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19140  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19141  * memcpy(dst_data, src_data, itemsize * dst_extent)
19142  */
19143  goto __pyx_L4;
19144  }
19145 
19146  /* "View.MemoryView":1157
19147  * memcpy(dst_data, src_data, itemsize * dst_extent)
19148  * else:
19149  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19150  * memcpy(dst_data, src_data, itemsize)
19151  * src_data += src_stride
19152  */
19153  /*else*/ {
19154  __pyx_t_4 = __pyx_v_dst_extent;
19155  __pyx_t_5 = __pyx_t_4;
19156  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19157  __pyx_v_i = __pyx_t_6;
19158 
19159  /* "View.MemoryView":1158
19160  * else:
19161  * for i in range(dst_extent):
19162  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19163  * src_data += src_stride
19164  * dst_data += dst_stride
19165  */
19166  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19167 
19168  /* "View.MemoryView":1159
19169  * for i in range(dst_extent):
19170  * memcpy(dst_data, src_data, itemsize)
19171  * src_data += src_stride # <<<<<<<<<<<<<<
19172  * dst_data += dst_stride
19173  * else:
19174  */
19175  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19176 
19177  /* "View.MemoryView":1160
19178  * memcpy(dst_data, src_data, itemsize)
19179  * src_data += src_stride
19180  * dst_data += dst_stride # <<<<<<<<<<<<<<
19181  * else:
19182  * for i in range(dst_extent):
19183  */
19184  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19185  }
19186  }
19187  __pyx_L4:;
19188 
19189  /* "View.MemoryView":1152
19190  * cdef Py_ssize_t dst_stride = dst_strides[0]
19191  *
19192  * if ndim == 1: # <<<<<<<<<<<<<<
19193  * if (src_stride > 0 and dst_stride > 0 and
19194  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19195  */
19196  goto __pyx_L3;
19197  }
19198 
19199  /* "View.MemoryView":1162
19200  * dst_data += dst_stride
19201  * else:
19202  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19203  * _copy_strided_to_strided(src_data, src_strides + 1,
19204  * dst_data, dst_strides + 1,
19205  */
19206  /*else*/ {
19207  __pyx_t_4 = __pyx_v_dst_extent;
19208  __pyx_t_5 = __pyx_t_4;
19209  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19210  __pyx_v_i = __pyx_t_6;
19211 
19212  /* "View.MemoryView":1163
19213  * else:
19214  * for i in range(dst_extent):
19215  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19216  * dst_data, dst_strides + 1,
19217  * src_shape + 1, dst_shape + 1,
19218  */
19219  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19220 
19221  /* "View.MemoryView":1167
19222  * src_shape + 1, dst_shape + 1,
19223  * ndim - 1, itemsize)
19224  * src_data += src_stride # <<<<<<<<<<<<<<
19225  * dst_data += dst_stride
19226  *
19227  */
19228  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19229 
19230  /* "View.MemoryView":1168
19231  * ndim - 1, itemsize)
19232  * src_data += src_stride
19233  * dst_data += dst_stride # <<<<<<<<<<<<<<
19234  *
19235  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19236  */
19237  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19238  }
19239  }
19240  __pyx_L3:;
19241 
19242  /* "View.MemoryView":1140
19243  *
19244  * @cython.cdivision(True)
19245  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19246  * char *dst_data, Py_ssize_t *dst_strides,
19247  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19248  */
19249 
19250  /* function exit code */
19251 }
19252 
19253 /* "View.MemoryView":1170
19254  * dst_data += dst_stride
19255  *
19256  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19257  * __Pyx_memviewslice *dst,
19258  * int ndim, size_t itemsize) nogil:
19259  */
19260 
19261 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19262  __Pyx_TraceDeclarations
19263  int __pyx_lineno = 0;
19264  const char *__pyx_filename = NULL;
19265  int __pyx_clineno = 0;
19266  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
19267 
19268  /* "View.MemoryView":1173
19269  * __Pyx_memviewslice *dst,
19270  * int ndim, size_t itemsize) nogil:
19271  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19272  * src.shape, dst.shape, ndim, itemsize)
19273  *
19274  */
19275  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19276 
19277  /* "View.MemoryView":1170
19278  * dst_data += dst_stride
19279  *
19280  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19281  * __Pyx_memviewslice *dst,
19282  * int ndim, size_t itemsize) nogil:
19283  */
19284 
19285  /* function exit code */
19286  goto __pyx_L0;
19287  __pyx_L1_error:;
19288  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19289  __pyx_L0:;
19290  __Pyx_TraceReturn(Py_None, 1);
19291 }
19292 
19293 /* "View.MemoryView":1177
19294  *
19295  * @cname('__pyx_memoryview_slice_get_size')
19296  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19297  * "Return the size of the memory occupied by the slice in number of bytes"
19298  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19299  */
19300 
19301 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19302  Py_ssize_t __pyx_v_shape;
19303  Py_ssize_t __pyx_v_size;
19304  Py_ssize_t __pyx_r;
19305  __Pyx_TraceDeclarations
19306  Py_ssize_t __pyx_t_1;
19307  Py_ssize_t *__pyx_t_2;
19308  Py_ssize_t *__pyx_t_3;
19309  Py_ssize_t *__pyx_t_4;
19310  int __pyx_lineno = 0;
19311  const char *__pyx_filename = NULL;
19312  int __pyx_clineno = 0;
19313  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
19314 
19315  /* "View.MemoryView":1179
19316  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19317  * "Return the size of the memory occupied by the slice in number of bytes"
19318  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19319  *
19320  * for shape in src.shape[:ndim]:
19321  */
19322  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19323  __pyx_v_size = __pyx_t_1;
19324 
19325  /* "View.MemoryView":1181
19326  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19327  *
19328  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19329  * size *= shape
19330  *
19331  */
19332  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19333  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19334  __pyx_t_2 = __pyx_t_4;
19335  __pyx_v_shape = (__pyx_t_2[0]);
19336 
19337  /* "View.MemoryView":1182
19338  *
19339  * for shape in src.shape[:ndim]:
19340  * size *= shape # <<<<<<<<<<<<<<
19341  *
19342  * return size
19343  */
19344  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19345  }
19346 
19347  /* "View.MemoryView":1184
19348  * size *= shape
19349  *
19350  * return size # <<<<<<<<<<<<<<
19351  *
19352  * @cname('__pyx_fill_contig_strides_array')
19353  */
19354  __pyx_r = __pyx_v_size;
19355  goto __pyx_L0;
19356 
19357  /* "View.MemoryView":1177
19358  *
19359  * @cname('__pyx_memoryview_slice_get_size')
19360  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19361  * "Return the size of the memory occupied by the slice in number of bytes"
19362  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19363  */
19364 
19365  /* function exit code */
19366  __pyx_L1_error:;
19367  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19368  __pyx_r = 0;
19369  __pyx_L0:;
19370  __Pyx_TraceReturn(Py_None, 1);
19371  return __pyx_r;
19372 }
19373 
19374 /* "View.MemoryView":1187
19375  *
19376  * @cname('__pyx_fill_contig_strides_array')
19377  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19378  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19379  * int ndim, char order) nogil:
19380  */
19381 
19382 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19383  int __pyx_v_idx;
19384  Py_ssize_t __pyx_r;
19385  __Pyx_TraceDeclarations
19386  int __pyx_t_1;
19387  int __pyx_t_2;
19388  int __pyx_t_3;
19389  int __pyx_t_4;
19390  int __pyx_lineno = 0;
19391  const char *__pyx_filename = NULL;
19392  int __pyx_clineno = 0;
19393  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
19394 
19395  /* "View.MemoryView":1196
19396  * cdef int idx
19397  *
19398  * if order == 'F': # <<<<<<<<<<<<<<
19399  * for idx in range(ndim):
19400  * strides[idx] = stride
19401  */
19402  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19403  if (__pyx_t_1) {
19404 
19405  /* "View.MemoryView":1197
19406  *
19407  * if order == 'F':
19408  * for idx in range(ndim): # <<<<<<<<<<<<<<
19409  * strides[idx] = stride
19410  * stride *= shape[idx]
19411  */
19412  __pyx_t_2 = __pyx_v_ndim;
19413  __pyx_t_3 = __pyx_t_2;
19414  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19415  __pyx_v_idx = __pyx_t_4;
19416 
19417  /* "View.MemoryView":1198
19418  * if order == 'F':
19419  * for idx in range(ndim):
19420  * strides[idx] = stride # <<<<<<<<<<<<<<
19421  * stride *= shape[idx]
19422  * else:
19423  */
19424  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19425 
19426  /* "View.MemoryView":1199
19427  * for idx in range(ndim):
19428  * strides[idx] = stride
19429  * stride *= shape[idx] # <<<<<<<<<<<<<<
19430  * else:
19431  * for idx in range(ndim - 1, -1, -1):
19432  */
19433  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19434  }
19435 
19436  /* "View.MemoryView":1196
19437  * cdef int idx
19438  *
19439  * if order == 'F': # <<<<<<<<<<<<<<
19440  * for idx in range(ndim):
19441  * strides[idx] = stride
19442  */
19443  goto __pyx_L3;
19444  }
19445 
19446  /* "View.MemoryView":1201
19447  * stride *= shape[idx]
19448  * else:
19449  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19450  * strides[idx] = stride
19451  * stride *= shape[idx]
19452  */
19453  /*else*/ {
19454  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19455  __pyx_v_idx = __pyx_t_2;
19456 
19457  /* "View.MemoryView":1202
19458  * else:
19459  * for idx in range(ndim - 1, -1, -1):
19460  * strides[idx] = stride # <<<<<<<<<<<<<<
19461  * stride *= shape[idx]
19462  *
19463  */
19464  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19465 
19466  /* "View.MemoryView":1203
19467  * for idx in range(ndim - 1, -1, -1):
19468  * strides[idx] = stride
19469  * stride *= shape[idx] # <<<<<<<<<<<<<<
19470  *
19471  * return stride
19472  */
19473  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19474  }
19475  }
19476  __pyx_L3:;
19477 
19478  /* "View.MemoryView":1205
19479  * stride *= shape[idx]
19480  *
19481  * return stride # <<<<<<<<<<<<<<
19482  *
19483  * @cname('__pyx_memoryview_copy_data_to_temp')
19484  */
19485  __pyx_r = __pyx_v_stride;
19486  goto __pyx_L0;
19487 
19488  /* "View.MemoryView":1187
19489  *
19490  * @cname('__pyx_fill_contig_strides_array')
19491  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19492  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19493  * int ndim, char order) nogil:
19494  */
19495 
19496  /* function exit code */
19497  __pyx_L1_error:;
19498  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19499  __pyx_r = 0;
19500  __pyx_L0:;
19501  __Pyx_TraceReturn(Py_None, 1);
19502  return __pyx_r;
19503 }
19504 
19505 /* "View.MemoryView":1208
19506  *
19507  * @cname('__pyx_memoryview_copy_data_to_temp')
19508  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19509  * __Pyx_memviewslice *tmpslice,
19510  * char order,
19511  */
19512 
19513 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19514  int __pyx_v_i;
19515  void *__pyx_v_result;
19516  size_t __pyx_v_itemsize;
19517  size_t __pyx_v_size;
19518  void *__pyx_r;
19519  __Pyx_TraceDeclarations
19520  Py_ssize_t __pyx_t_1;
19521  int __pyx_t_2;
19522  int __pyx_t_3;
19523  struct __pyx_memoryview_obj *__pyx_t_4;
19524  int __pyx_t_5;
19525  int __pyx_t_6;
19526  int __pyx_lineno = 0;
19527  const char *__pyx_filename = NULL;
19528  int __pyx_clineno = 0;
19529  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19530 
19531  /* "View.MemoryView":1219
19532  * cdef void *result
19533  *
19534  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19535  * cdef size_t size = slice_get_size(src, ndim)
19536  *
19537  */
19538  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19539  __pyx_v_itemsize = __pyx_t_1;
19540 
19541  /* "View.MemoryView":1220
19542  *
19543  * cdef size_t itemsize = src.memview.view.itemsize
19544  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19545  *
19546  * result = malloc(size)
19547  */
19548  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19549 
19550  /* "View.MemoryView":1222
19551  * cdef size_t size = slice_get_size(src, ndim)
19552  *
19553  * result = malloc(size) # <<<<<<<<<<<<<<
19554  * if not result:
19555  * _err(MemoryError, NULL)
19556  */
19557  __pyx_v_result = malloc(__pyx_v_size);
19558 
19559  /* "View.MemoryView":1223
19560  *
19561  * result = malloc(size)
19562  * if not result: # <<<<<<<<<<<<<<
19563  * _err(MemoryError, NULL)
19564  *
19565  */
19566  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19567  if (__pyx_t_2) {
19568 
19569  /* "View.MemoryView":1224
19570  * result = malloc(size)
19571  * if not result:
19572  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19573  *
19574  *
19575  */
19576  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19577 
19578  /* "View.MemoryView":1223
19579  *
19580  * result = malloc(size)
19581  * if not result: # <<<<<<<<<<<<<<
19582  * _err(MemoryError, NULL)
19583  *
19584  */
19585  }
19586 
19587  /* "View.MemoryView":1227
19588  *
19589  *
19590  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19591  * tmpslice.memview = src.memview
19592  * for i in range(ndim):
19593  */
19594  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19595 
19596  /* "View.MemoryView":1228
19597  *
19598  * tmpslice.data = <char *> result
19599  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19600  * for i in range(ndim):
19601  * tmpslice.shape[i] = src.shape[i]
19602  */
19603  __pyx_t_4 = __pyx_v_src->memview;
19604  __pyx_v_tmpslice->memview = __pyx_t_4;
19605 
19606  /* "View.MemoryView":1229
19607  * tmpslice.data = <char *> result
19608  * tmpslice.memview = src.memview
19609  * for i in range(ndim): # <<<<<<<<<<<<<<
19610  * tmpslice.shape[i] = src.shape[i]
19611  * tmpslice.suboffsets[i] = -1
19612  */
19613  __pyx_t_3 = __pyx_v_ndim;
19614  __pyx_t_5 = __pyx_t_3;
19615  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19616  __pyx_v_i = __pyx_t_6;
19617 
19618  /* "View.MemoryView":1230
19619  * tmpslice.memview = src.memview
19620  * for i in range(ndim):
19621  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19622  * tmpslice.suboffsets[i] = -1
19623  *
19624  */
19625  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19626 
19627  /* "View.MemoryView":1231
19628  * for i in range(ndim):
19629  * tmpslice.shape[i] = src.shape[i]
19630  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19631  *
19632  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19633  */
19634  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19635  }
19636 
19637  /* "View.MemoryView":1233
19638  * tmpslice.suboffsets[i] = -1
19639  *
19640  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19641  * ndim, order)
19642  *
19643  */
19644  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19645 
19646  /* "View.MemoryView":1237
19647  *
19648  *
19649  * for i in range(ndim): # <<<<<<<<<<<<<<
19650  * if tmpslice.shape[i] == 1:
19651  * tmpslice.strides[i] = 0
19652  */
19653  __pyx_t_3 = __pyx_v_ndim;
19654  __pyx_t_5 = __pyx_t_3;
19655  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19656  __pyx_v_i = __pyx_t_6;
19657 
19658  /* "View.MemoryView":1238
19659  *
19660  * for i in range(ndim):
19661  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19662  * tmpslice.strides[i] = 0
19663  *
19664  */
19665  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19666  if (__pyx_t_2) {
19667 
19668  /* "View.MemoryView":1239
19669  * for i in range(ndim):
19670  * if tmpslice.shape[i] == 1:
19671  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19672  *
19673  * if slice_is_contig(src[0], order, ndim):
19674  */
19675  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19676 
19677  /* "View.MemoryView":1238
19678  *
19679  * for i in range(ndim):
19680  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19681  * tmpslice.strides[i] = 0
19682  *
19683  */
19684  }
19685  }
19686 
19687  /* "View.MemoryView":1241
19688  * tmpslice.strides[i] = 0
19689  *
19690  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19691  * memcpy(result, src.data, size)
19692  * else:
19693  */
19694  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19695  if (__pyx_t_2) {
19696 
19697  /* "View.MemoryView":1242
19698  *
19699  * if slice_is_contig(src[0], order, ndim):
19700  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19701  * else:
19702  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19703  */
19704  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19705 
19706  /* "View.MemoryView":1241
19707  * tmpslice.strides[i] = 0
19708  *
19709  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19710  * memcpy(result, src.data, size)
19711  * else:
19712  */
19713  goto __pyx_L9;
19714  }
19715 
19716  /* "View.MemoryView":1244
19717  * memcpy(result, src.data, size)
19718  * else:
19719  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19720  *
19721  * return result
19722  */
19723  /*else*/ {
19724  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19725  }
19726  __pyx_L9:;
19727 
19728  /* "View.MemoryView":1246
19729  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19730  *
19731  * return result # <<<<<<<<<<<<<<
19732  *
19733  *
19734  */
19735  __pyx_r = __pyx_v_result;
19736  goto __pyx_L0;
19737 
19738  /* "View.MemoryView":1208
19739  *
19740  * @cname('__pyx_memoryview_copy_data_to_temp')
19741  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19742  * __Pyx_memviewslice *tmpslice,
19743  * char order,
19744  */
19745 
19746  /* function exit code */
19747  __pyx_L1_error:;
19748  {
19749  #ifdef WITH_THREAD
19750  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19751  #endif
19752  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19753  #ifdef WITH_THREAD
19754  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19755  #endif
19756  }
19757  __pyx_r = NULL;
19758  __pyx_L0:;
19759  __Pyx_TraceReturn(Py_None, 1);
19760  return __pyx_r;
19761 }
19762 
19763 /* "View.MemoryView":1251
19764  *
19765  * @cname('__pyx_memoryview_err_extents')
19766  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19767  * Py_ssize_t extent2) except -1 with gil:
19768  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19769  */
19770 
19771 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19772  int __pyx_r;
19773  __Pyx_TraceDeclarations
19774  __Pyx_RefNannyDeclarations
19775  PyObject *__pyx_t_1 = NULL;
19776  PyObject *__pyx_t_2 = NULL;
19777  PyObject *__pyx_t_3 = NULL;
19778  PyObject *__pyx_t_4 = NULL;
19779  int __pyx_lineno = 0;
19780  const char *__pyx_filename = NULL;
19781  int __pyx_clineno = 0;
19782  #ifdef WITH_THREAD
19783  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19784  #endif
19785  __Pyx_RefNannySetupContext("_err_extents", 0);
19786  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19787 
19788  /* "View.MemoryView":1254
19789  * Py_ssize_t extent2) except -1 with gil:
19790  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19791  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19792  *
19793  * @cname('__pyx_memoryview_err_dim')
19794  */
19795  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19796  __Pyx_GOTREF(__pyx_t_1);
19797  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19798  __Pyx_GOTREF(__pyx_t_2);
19799  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19800  __Pyx_GOTREF(__pyx_t_3);
19801  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19802  __Pyx_GOTREF(__pyx_t_4);
19803  __Pyx_GIVEREF(__pyx_t_1);
19804  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19805  __Pyx_GIVEREF(__pyx_t_2);
19806  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19807  __Pyx_GIVEREF(__pyx_t_3);
19808  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19809  __pyx_t_1 = 0;
19810  __pyx_t_2 = 0;
19811  __pyx_t_3 = 0;
19812 
19813  /* "View.MemoryView":1253
19814  * cdef int _err_extents(int i, Py_ssize_t extent1,
19815  * Py_ssize_t extent2) except -1 with gil:
19816  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19817  * (i, extent1, extent2))
19818  *
19819  */
19820  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19821  __Pyx_GOTREF(__pyx_t_3);
19822  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19823  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19824  __Pyx_GOTREF(__pyx_t_4);
19825  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19826  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19827  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19828  __PYX_ERR(1, 1253, __pyx_L1_error)
19829 
19830  /* "View.MemoryView":1251
19831  *
19832  * @cname('__pyx_memoryview_err_extents')
19833  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19834  * Py_ssize_t extent2) except -1 with gil:
19835  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19836  */
19837 
19838  /* function exit code */
19839  __pyx_L1_error:;
19840  __Pyx_XDECREF(__pyx_t_1);
19841  __Pyx_XDECREF(__pyx_t_2);
19842  __Pyx_XDECREF(__pyx_t_3);
19843  __Pyx_XDECREF(__pyx_t_4);
19844  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19845  __pyx_r = -1;
19846  __Pyx_TraceReturn(Py_None, 0);
19847  __Pyx_RefNannyFinishContext();
19848  #ifdef WITH_THREAD
19849  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19850  #endif
19851  return __pyx_r;
19852 }
19853 
19854 /* "View.MemoryView":1257
19855  *
19856  * @cname('__pyx_memoryview_err_dim')
19857  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19858  * raise error(msg.decode('ascii') % dim)
19859  *
19860  */
19861 
19862 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19863  int __pyx_r;
19864  __Pyx_TraceDeclarations
19865  __Pyx_RefNannyDeclarations
19866  PyObject *__pyx_t_1 = NULL;
19867  PyObject *__pyx_t_2 = NULL;
19868  PyObject *__pyx_t_3 = NULL;
19869  PyObject *__pyx_t_4 = NULL;
19870  int __pyx_lineno = 0;
19871  const char *__pyx_filename = NULL;
19872  int __pyx_clineno = 0;
19873  #ifdef WITH_THREAD
19874  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19875  #endif
19876  __Pyx_RefNannySetupContext("_err_dim", 0);
19877  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19878  __Pyx_INCREF(__pyx_v_error);
19879 
19880  /* "View.MemoryView":1258
19881  * @cname('__pyx_memoryview_err_dim')
19882  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19883  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19884  *
19885  * @cname('__pyx_memoryview_err')
19886  */
19887  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19888  __Pyx_GOTREF(__pyx_t_2);
19889  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19890  __Pyx_GOTREF(__pyx_t_3);
19891  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19892  __Pyx_GOTREF(__pyx_t_4);
19893  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19894  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19895  __Pyx_INCREF(__pyx_v_error);
19896  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19897  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19898  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19899  if (likely(__pyx_t_2)) {
19900  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19901  __Pyx_INCREF(__pyx_t_2);
19902  __Pyx_INCREF(function);
19903  __Pyx_DECREF_SET(__pyx_t_3, function);
19904  }
19905  }
19906  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19907  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19908  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19909  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19910  __Pyx_GOTREF(__pyx_t_1);
19911  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19912  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19913  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19914  __PYX_ERR(1, 1258, __pyx_L1_error)
19915 
19916  /* "View.MemoryView":1257
19917  *
19918  * @cname('__pyx_memoryview_err_dim')
19919  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19920  * raise error(msg.decode('ascii') % dim)
19921  *
19922  */
19923 
19924  /* function exit code */
19925  __pyx_L1_error:;
19926  __Pyx_XDECREF(__pyx_t_1);
19927  __Pyx_XDECREF(__pyx_t_2);
19928  __Pyx_XDECREF(__pyx_t_3);
19929  __Pyx_XDECREF(__pyx_t_4);
19930  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19931  __pyx_r = -1;
19932  __Pyx_XDECREF(__pyx_v_error);
19933  __Pyx_TraceReturn(Py_None, 0);
19934  __Pyx_RefNannyFinishContext();
19935  #ifdef WITH_THREAD
19936  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19937  #endif
19938  return __pyx_r;
19939 }
19940 
19941 /* "View.MemoryView":1261
19942  *
19943  * @cname('__pyx_memoryview_err')
19944  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19945  * if msg != NULL:
19946  * raise error(msg.decode('ascii'))
19947  */
19948 
19949 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19950  int __pyx_r;
19951  __Pyx_TraceDeclarations
19952  __Pyx_RefNannyDeclarations
19953  int __pyx_t_1;
19954  PyObject *__pyx_t_2 = NULL;
19955  PyObject *__pyx_t_3 = NULL;
19956  PyObject *__pyx_t_4 = NULL;
19957  PyObject *__pyx_t_5 = NULL;
19958  int __pyx_lineno = 0;
19959  const char *__pyx_filename = NULL;
19960  int __pyx_clineno = 0;
19961  #ifdef WITH_THREAD
19962  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19963  #endif
19964  __Pyx_RefNannySetupContext("_err", 0);
19965  __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19966  __Pyx_INCREF(__pyx_v_error);
19967 
19968  /* "View.MemoryView":1262
19969  * @cname('__pyx_memoryview_err')
19970  * cdef int _err(object error, char *msg) except -1 with gil:
19971  * if msg != NULL: # <<<<<<<<<<<<<<
19972  * raise error(msg.decode('ascii'))
19973  * else:
19974  */
19975  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19976  if (unlikely(__pyx_t_1)) {
19977 
19978  /* "View.MemoryView":1263
19979  * cdef int _err(object error, char *msg) except -1 with gil:
19980  * if msg != NULL:
19981  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19982  * else:
19983  * raise error
19984  */
19985  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19986  __Pyx_GOTREF(__pyx_t_3);
19987  __Pyx_INCREF(__pyx_v_error);
19988  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19989  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19990  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19991  if (likely(__pyx_t_5)) {
19992  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19993  __Pyx_INCREF(__pyx_t_5);
19994  __Pyx_INCREF(function);
19995  __Pyx_DECREF_SET(__pyx_t_4, function);
19996  }
19997  }
19998  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19999  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20000  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20001  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20002  __Pyx_GOTREF(__pyx_t_2);
20003  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20004  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20005  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20006  __PYX_ERR(1, 1263, __pyx_L1_error)
20007 
20008  /* "View.MemoryView":1262
20009  * @cname('__pyx_memoryview_err')
20010  * cdef int _err(object error, char *msg) except -1 with gil:
20011  * if msg != NULL: # <<<<<<<<<<<<<<
20012  * raise error(msg.decode('ascii'))
20013  * else:
20014  */
20015  }
20016 
20017  /* "View.MemoryView":1265
20018  * raise error(msg.decode('ascii'))
20019  * else:
20020  * raise error # <<<<<<<<<<<<<<
20021  *
20022  * @cname('__pyx_memoryview_copy_contents')
20023  */
20024  /*else*/ {
20025  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20026  __PYX_ERR(1, 1265, __pyx_L1_error)
20027  }
20028 
20029  /* "View.MemoryView":1261
20030  *
20031  * @cname('__pyx_memoryview_err')
20032  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20033  * if msg != NULL:
20034  * raise error(msg.decode('ascii'))
20035  */
20036 
20037  /* function exit code */
20038  __pyx_L1_error:;
20039  __Pyx_XDECREF(__pyx_t_2);
20040  __Pyx_XDECREF(__pyx_t_3);
20041  __Pyx_XDECREF(__pyx_t_4);
20042  __Pyx_XDECREF(__pyx_t_5);
20043  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20044  __pyx_r = -1;
20045  __Pyx_XDECREF(__pyx_v_error);
20046  __Pyx_TraceReturn(Py_None, 0);
20047  __Pyx_RefNannyFinishContext();
20048  #ifdef WITH_THREAD
20049  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20050  #endif
20051  return __pyx_r;
20052 }
20053 
20054 /* "View.MemoryView":1268
20055  *
20056  * @cname('__pyx_memoryview_copy_contents')
20057  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20058  * __Pyx_memviewslice dst,
20059  * int src_ndim, int dst_ndim,
20060  */
20061 
20062 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20063  void *__pyx_v_tmpdata;
20064  size_t __pyx_v_itemsize;
20065  int __pyx_v_i;
20066  char __pyx_v_order;
20067  int __pyx_v_broadcasting;
20068  int __pyx_v_direct_copy;
20069  __Pyx_memviewslice __pyx_v_tmp;
20070  int __pyx_v_ndim;
20071  int __pyx_r;
20072  __Pyx_TraceDeclarations
20073  Py_ssize_t __pyx_t_1;
20074  int __pyx_t_2;
20075  int __pyx_t_3;
20076  int __pyx_t_4;
20077  int __pyx_t_5;
20078  int __pyx_t_6;
20079  void *__pyx_t_7;
20080  int __pyx_t_8;
20081  int __pyx_lineno = 0;
20082  const char *__pyx_filename = NULL;
20083  int __pyx_clineno = 0;
20084  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
20085 
20086  /* "View.MemoryView":1276
20087  * Check for overlapping memory and verify the shapes.
20088  * """
20089  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20090  * cdef size_t itemsize = src.memview.view.itemsize
20091  * cdef int i
20092  */
20093  __pyx_v_tmpdata = NULL;
20094 
20095  /* "View.MemoryView":1277
20096  * """
20097  * cdef void *tmpdata = NULL
20098  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20099  * cdef int i
20100  * cdef char order = get_best_order(&src, src_ndim)
20101  */
20102  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20103  __pyx_v_itemsize = __pyx_t_1;
20104 
20105  /* "View.MemoryView":1279
20106  * cdef size_t itemsize = src.memview.view.itemsize
20107  * cdef int i
20108  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20109  * cdef bint broadcasting = False
20110  * cdef bint direct_copy = False
20111  */
20112  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20113 
20114  /* "View.MemoryView":1280
20115  * cdef int i
20116  * cdef char order = get_best_order(&src, src_ndim)
20117  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20118  * cdef bint direct_copy = False
20119  * cdef __Pyx_memviewslice tmp
20120  */
20121  __pyx_v_broadcasting = 0;
20122 
20123  /* "View.MemoryView":1281
20124  * cdef char order = get_best_order(&src, src_ndim)
20125  * cdef bint broadcasting = False
20126  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20127  * cdef __Pyx_memviewslice tmp
20128  *
20129  */
20130  __pyx_v_direct_copy = 0;
20131 
20132  /* "View.MemoryView":1284
20133  * cdef __Pyx_memviewslice tmp
20134  *
20135  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20136  * broadcast_leading(&src, src_ndim, dst_ndim)
20137  * elif dst_ndim < src_ndim:
20138  */
20139  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20140  if (__pyx_t_2) {
20141 
20142  /* "View.MemoryView":1285
20143  *
20144  * if src_ndim < dst_ndim:
20145  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20146  * elif dst_ndim < src_ndim:
20147  * broadcast_leading(&dst, dst_ndim, src_ndim)
20148  */
20149  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20150 
20151  /* "View.MemoryView":1284
20152  * cdef __Pyx_memviewslice tmp
20153  *
20154  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20155  * broadcast_leading(&src, src_ndim, dst_ndim)
20156  * elif dst_ndim < src_ndim:
20157  */
20158  goto __pyx_L3;
20159  }
20160 
20161  /* "View.MemoryView":1286
20162  * if src_ndim < dst_ndim:
20163  * broadcast_leading(&src, src_ndim, dst_ndim)
20164  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20165  * broadcast_leading(&dst, dst_ndim, src_ndim)
20166  *
20167  */
20168  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20169  if (__pyx_t_2) {
20170 
20171  /* "View.MemoryView":1287
20172  * broadcast_leading(&src, src_ndim, dst_ndim)
20173  * elif dst_ndim < src_ndim:
20174  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20175  *
20176  * cdef int ndim = max(src_ndim, dst_ndim)
20177  */
20178  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20179 
20180  /* "View.MemoryView":1286
20181  * if src_ndim < dst_ndim:
20182  * broadcast_leading(&src, src_ndim, dst_ndim)
20183  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20184  * broadcast_leading(&dst, dst_ndim, src_ndim)
20185  *
20186  */
20187  }
20188  __pyx_L3:;
20189 
20190  /* "View.MemoryView":1289
20191  * broadcast_leading(&dst, dst_ndim, src_ndim)
20192  *
20193  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20194  *
20195  * for i in range(ndim):
20196  */
20197  __pyx_t_3 = __pyx_v_dst_ndim;
20198  __pyx_t_4 = __pyx_v_src_ndim;
20199  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20200  __pyx_t_5 = __pyx_t_3;
20201  } else {
20202  __pyx_t_5 = __pyx_t_4;
20203  }
20204  __pyx_v_ndim = __pyx_t_5;
20205 
20206  /* "View.MemoryView":1291
20207  * cdef int ndim = max(src_ndim, dst_ndim)
20208  *
20209  * for i in range(ndim): # <<<<<<<<<<<<<<
20210  * if src.shape[i] != dst.shape[i]:
20211  * if src.shape[i] == 1:
20212  */
20213  __pyx_t_5 = __pyx_v_ndim;
20214  __pyx_t_3 = __pyx_t_5;
20215  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20216  __pyx_v_i = __pyx_t_4;
20217 
20218  /* "View.MemoryView":1292
20219  *
20220  * for i in range(ndim):
20221  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20222  * if src.shape[i] == 1:
20223  * broadcasting = True
20224  */
20225  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20226  if (__pyx_t_2) {
20227 
20228  /* "View.MemoryView":1293
20229  * for i in range(ndim):
20230  * if src.shape[i] != dst.shape[i]:
20231  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20232  * broadcasting = True
20233  * src.strides[i] = 0
20234  */
20235  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20236  if (__pyx_t_2) {
20237 
20238  /* "View.MemoryView":1294
20239  * if src.shape[i] != dst.shape[i]:
20240  * if src.shape[i] == 1:
20241  * broadcasting = True # <<<<<<<<<<<<<<
20242  * src.strides[i] = 0
20243  * else:
20244  */
20245  __pyx_v_broadcasting = 1;
20246 
20247  /* "View.MemoryView":1295
20248  * if src.shape[i] == 1:
20249  * broadcasting = True
20250  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20251  * else:
20252  * _err_extents(i, dst.shape[i], src.shape[i])
20253  */
20254  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20255 
20256  /* "View.MemoryView":1293
20257  * for i in range(ndim):
20258  * if src.shape[i] != dst.shape[i]:
20259  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20260  * broadcasting = True
20261  * src.strides[i] = 0
20262  */
20263  goto __pyx_L7;
20264  }
20265 
20266  /* "View.MemoryView":1297
20267  * src.strides[i] = 0
20268  * else:
20269  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20270  *
20271  * if src.suboffsets[i] >= 0:
20272  */
20273  /*else*/ {
20274  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20275  }
20276  __pyx_L7:;
20277 
20278  /* "View.MemoryView":1292
20279  *
20280  * for i in range(ndim):
20281  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20282  * if src.shape[i] == 1:
20283  * broadcasting = True
20284  */
20285  }
20286 
20287  /* "View.MemoryView":1299
20288  * _err_extents(i, dst.shape[i], src.shape[i])
20289  *
20290  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20291  * _err_dim(ValueError, "Dimension %d is not direct", i)
20292  *
20293  */
20294  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20295  if (__pyx_t_2) {
20296 
20297  /* "View.MemoryView":1300
20298  *
20299  * if src.suboffsets[i] >= 0:
20300  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20301  *
20302  * if slices_overlap(&src, &dst, ndim, itemsize):
20303  */
20304  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20305 
20306  /* "View.MemoryView":1299
20307  * _err_extents(i, dst.shape[i], src.shape[i])
20308  *
20309  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20310  * _err_dim(ValueError, "Dimension %d is not direct", i)
20311  *
20312  */
20313  }
20314  }
20315 
20316  /* "View.MemoryView":1302
20317  * _err_dim(ValueError, "Dimension %d is not direct", i)
20318  *
20319  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20320  *
20321  * if not slice_is_contig(src, order, ndim):
20322  */
20323  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20324  if (__pyx_t_2) {
20325 
20326  /* "View.MemoryView":1304
20327  * if slices_overlap(&src, &dst, ndim, itemsize):
20328  *
20329  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20330  * order = get_best_order(&dst, ndim)
20331  *
20332  */
20333  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20334  if (__pyx_t_2) {
20335 
20336  /* "View.MemoryView":1305
20337  *
20338  * if not slice_is_contig(src, order, ndim):
20339  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20340  *
20341  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20342  */
20343  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20344 
20345  /* "View.MemoryView":1304
20346  * if slices_overlap(&src, &dst, ndim, itemsize):
20347  *
20348  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20349  * order = get_best_order(&dst, ndim)
20350  *
20351  */
20352  }
20353 
20354  /* "View.MemoryView":1307
20355  * order = get_best_order(&dst, ndim)
20356  *
20357  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20358  * src = tmp
20359  *
20360  */
20361  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20362  __pyx_v_tmpdata = __pyx_t_7;
20363 
20364  /* "View.MemoryView":1308
20365  *
20366  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20367  * src = tmp # <<<<<<<<<<<<<<
20368  *
20369  * if not broadcasting:
20370  */
20371  __pyx_v_src = __pyx_v_tmp;
20372 
20373  /* "View.MemoryView":1302
20374  * _err_dim(ValueError, "Dimension %d is not direct", i)
20375  *
20376  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20377  *
20378  * if not slice_is_contig(src, order, ndim):
20379  */
20380  }
20381 
20382  /* "View.MemoryView":1310
20383  * src = tmp
20384  *
20385  * if not broadcasting: # <<<<<<<<<<<<<<
20386  *
20387  *
20388  */
20389  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20390  if (__pyx_t_2) {
20391 
20392  /* "View.MemoryView":1313
20393  *
20394  *
20395  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20396  * direct_copy = slice_is_contig(dst, 'C', ndim)
20397  * elif slice_is_contig(src, 'F', ndim):
20398  */
20399  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20400  if (__pyx_t_2) {
20401 
20402  /* "View.MemoryView":1314
20403  *
20404  * if slice_is_contig(src, 'C', ndim):
20405  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20406  * elif slice_is_contig(src, 'F', ndim):
20407  * direct_copy = slice_is_contig(dst, 'F', ndim)
20408  */
20409  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20410 
20411  /* "View.MemoryView":1313
20412  *
20413  *
20414  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20415  * direct_copy = slice_is_contig(dst, 'C', ndim)
20416  * elif slice_is_contig(src, 'F', ndim):
20417  */
20418  goto __pyx_L12;
20419  }
20420 
20421  /* "View.MemoryView":1315
20422  * if slice_is_contig(src, 'C', ndim):
20423  * direct_copy = slice_is_contig(dst, 'C', ndim)
20424  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20425  * direct_copy = slice_is_contig(dst, 'F', ndim)
20426  *
20427  */
20428  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20429  if (__pyx_t_2) {
20430 
20431  /* "View.MemoryView":1316
20432  * direct_copy = slice_is_contig(dst, 'C', ndim)
20433  * elif slice_is_contig(src, 'F', ndim):
20434  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20435  *
20436  * if direct_copy:
20437  */
20438  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20439 
20440  /* "View.MemoryView":1315
20441  * if slice_is_contig(src, 'C', ndim):
20442  * direct_copy = slice_is_contig(dst, 'C', ndim)
20443  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20444  * direct_copy = slice_is_contig(dst, 'F', ndim)
20445  *
20446  */
20447  }
20448  __pyx_L12:;
20449 
20450  /* "View.MemoryView":1318
20451  * direct_copy = slice_is_contig(dst, 'F', ndim)
20452  *
20453  * if direct_copy: # <<<<<<<<<<<<<<
20454  *
20455  * refcount_copying(&dst, dtype_is_object, ndim, False)
20456  */
20457  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20458  if (__pyx_t_2) {
20459 
20460  /* "View.MemoryView":1320
20461  * if direct_copy:
20462  *
20463  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20464  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20465  * refcount_copying(&dst, dtype_is_object, ndim, True)
20466  */
20467  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20468 
20469  /* "View.MemoryView":1321
20470  *
20471  * refcount_copying(&dst, dtype_is_object, ndim, False)
20472  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20473  * refcount_copying(&dst, dtype_is_object, ndim, True)
20474  * free(tmpdata)
20475  */
20476  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20477 
20478  /* "View.MemoryView":1322
20479  * refcount_copying(&dst, dtype_is_object, ndim, False)
20480  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20481  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20482  * free(tmpdata)
20483  * return 0
20484  */
20485  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20486 
20487  /* "View.MemoryView":1323
20488  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20489  * refcount_copying(&dst, dtype_is_object, ndim, True)
20490  * free(tmpdata) # <<<<<<<<<<<<<<
20491  * return 0
20492  *
20493  */
20494  free(__pyx_v_tmpdata);
20495 
20496  /* "View.MemoryView":1324
20497  * refcount_copying(&dst, dtype_is_object, ndim, True)
20498  * free(tmpdata)
20499  * return 0 # <<<<<<<<<<<<<<
20500  *
20501  * if order == 'F' == get_best_order(&dst, ndim):
20502  */
20503  __pyx_r = 0;
20504  goto __pyx_L0;
20505 
20506  /* "View.MemoryView":1318
20507  * direct_copy = slice_is_contig(dst, 'F', ndim)
20508  *
20509  * if direct_copy: # <<<<<<<<<<<<<<
20510  *
20511  * refcount_copying(&dst, dtype_is_object, ndim, False)
20512  */
20513  }
20514 
20515  /* "View.MemoryView":1310
20516  * src = tmp
20517  *
20518  * if not broadcasting: # <<<<<<<<<<<<<<
20519  *
20520  *
20521  */
20522  }
20523 
20524  /* "View.MemoryView":1326
20525  * return 0
20526  *
20527  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20528  *
20529  *
20530  */
20531  __pyx_t_2 = (__pyx_v_order == 'F');
20532  if (__pyx_t_2) {
20533  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20534  }
20535  __pyx_t_8 = (__pyx_t_2 != 0);
20536  if (__pyx_t_8) {
20537 
20538  /* "View.MemoryView":1329
20539  *
20540  *
20541  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20542  * transpose_memslice(&dst)
20543  *
20544  */
20545  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20546 
20547  /* "View.MemoryView":1330
20548  *
20549  * transpose_memslice(&src)
20550  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20551  *
20552  * refcount_copying(&dst, dtype_is_object, ndim, False)
20553  */
20554  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20555 
20556  /* "View.MemoryView":1326
20557  * return 0
20558  *
20559  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20560  *
20561  *
20562  */
20563  }
20564 
20565  /* "View.MemoryView":1332
20566  * transpose_memslice(&dst)
20567  *
20568  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20569  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20570  * refcount_copying(&dst, dtype_is_object, ndim, True)
20571  */
20572  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20573 
20574  /* "View.MemoryView":1333
20575  *
20576  * refcount_copying(&dst, dtype_is_object, ndim, False)
20577  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20578  * refcount_copying(&dst, dtype_is_object, ndim, True)
20579  *
20580  */
20581  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20582 
20583  /* "View.MemoryView":1334
20584  * refcount_copying(&dst, dtype_is_object, ndim, False)
20585  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20586  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20587  *
20588  * free(tmpdata)
20589  */
20590  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20591 
20592  /* "View.MemoryView":1336
20593  * refcount_copying(&dst, dtype_is_object, ndim, True)
20594  *
20595  * free(tmpdata) # <<<<<<<<<<<<<<
20596  * return 0
20597  *
20598  */
20599  free(__pyx_v_tmpdata);
20600 
20601  /* "View.MemoryView":1337
20602  *
20603  * free(tmpdata)
20604  * return 0 # <<<<<<<<<<<<<<
20605  *
20606  * @cname('__pyx_memoryview_broadcast_leading')
20607  */
20608  __pyx_r = 0;
20609  goto __pyx_L0;
20610 
20611  /* "View.MemoryView":1268
20612  *
20613  * @cname('__pyx_memoryview_copy_contents')
20614  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20615  * __Pyx_memviewslice dst,
20616  * int src_ndim, int dst_ndim,
20617  */
20618 
20619  /* function exit code */
20620  __pyx_L1_error:;
20621  {
20622  #ifdef WITH_THREAD
20623  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20624  #endif
20625  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20626  #ifdef WITH_THREAD
20627  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20628  #endif
20629  }
20630  __pyx_r = -1;
20631  __pyx_L0:;
20632  __Pyx_TraceReturn(Py_None, 1);
20633  return __pyx_r;
20634 }
20635 
20636 /* "View.MemoryView":1340
20637  *
20638  * @cname('__pyx_memoryview_broadcast_leading')
20639  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20640  * int ndim,
20641  * int ndim_other) nogil:
20642  */
20643 
20644 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20645  int __pyx_v_i;
20646  int __pyx_v_offset;
20647  __Pyx_TraceDeclarations
20648  int __pyx_t_1;
20649  int __pyx_t_2;
20650  int __pyx_t_3;
20651  int __pyx_lineno = 0;
20652  const char *__pyx_filename = NULL;
20653  int __pyx_clineno = 0;
20654  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20655 
20656  /* "View.MemoryView":1344
20657  * int ndim_other) nogil:
20658  * cdef int i
20659  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20660  *
20661  * for i in range(ndim - 1, -1, -1):
20662  */
20663  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20664 
20665  /* "View.MemoryView":1346
20666  * cdef int offset = ndim_other - ndim
20667  *
20668  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20669  * mslice.shape[i + offset] = mslice.shape[i]
20670  * mslice.strides[i + offset] = mslice.strides[i]
20671  */
20672  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20673  __pyx_v_i = __pyx_t_1;
20674 
20675  /* "View.MemoryView":1347
20676  *
20677  * for i in range(ndim - 1, -1, -1):
20678  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20679  * mslice.strides[i + offset] = mslice.strides[i]
20680  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20681  */
20682  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20683 
20684  /* "View.MemoryView":1348
20685  * for i in range(ndim - 1, -1, -1):
20686  * mslice.shape[i + offset] = mslice.shape[i]
20687  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20688  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20689  *
20690  */
20691  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20692 
20693  /* "View.MemoryView":1349
20694  * mslice.shape[i + offset] = mslice.shape[i]
20695  * mslice.strides[i + offset] = mslice.strides[i]
20696  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20697  *
20698  * for i in range(offset):
20699  */
20700  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20701  }
20702 
20703  /* "View.MemoryView":1351
20704  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20705  *
20706  * for i in range(offset): # <<<<<<<<<<<<<<
20707  * mslice.shape[i] = 1
20708  * mslice.strides[i] = mslice.strides[0]
20709  */
20710  __pyx_t_1 = __pyx_v_offset;
20711  __pyx_t_2 = __pyx_t_1;
20712  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20713  __pyx_v_i = __pyx_t_3;
20714 
20715  /* "View.MemoryView":1352
20716  *
20717  * for i in range(offset):
20718  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20719  * mslice.strides[i] = mslice.strides[0]
20720  * mslice.suboffsets[i] = -1
20721  */
20722  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20723 
20724  /* "View.MemoryView":1353
20725  * for i in range(offset):
20726  * mslice.shape[i] = 1
20727  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20728  * mslice.suboffsets[i] = -1
20729  *
20730  */
20731  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20732 
20733  /* "View.MemoryView":1354
20734  * mslice.shape[i] = 1
20735  * mslice.strides[i] = mslice.strides[0]
20736  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20737  *
20738  *
20739  */
20740  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20741  }
20742 
20743  /* "View.MemoryView":1340
20744  *
20745  * @cname('__pyx_memoryview_broadcast_leading')
20746  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20747  * int ndim,
20748  * int ndim_other) nogil:
20749  */
20750 
20751  /* function exit code */
20752  goto __pyx_L0;
20753  __pyx_L1_error:;
20754  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20755  __pyx_L0:;
20756  __Pyx_TraceReturn(Py_None, 1);
20757 }
20758 
20759 /* "View.MemoryView":1362
20760  *
20761  * @cname('__pyx_memoryview_refcount_copying')
20762  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20763  * int ndim, bint inc) nogil:
20764  *
20765  */
20766 
20767 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20768  __Pyx_TraceDeclarations
20769  int __pyx_t_1;
20770  int __pyx_lineno = 0;
20771  const char *__pyx_filename = NULL;
20772  int __pyx_clineno = 0;
20773  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20774 
20775  /* "View.MemoryView":1366
20776  *
20777  *
20778  * if dtype_is_object: # <<<<<<<<<<<<<<
20779  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20780  * dst.strides, ndim, inc)
20781  */
20782  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20783  if (__pyx_t_1) {
20784 
20785  /* "View.MemoryView":1367
20786  *
20787  * if dtype_is_object:
20788  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20789  * dst.strides, ndim, inc)
20790  *
20791  */
20792  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20793 
20794  /* "View.MemoryView":1366
20795  *
20796  *
20797  * if dtype_is_object: # <<<<<<<<<<<<<<
20798  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20799  * dst.strides, ndim, inc)
20800  */
20801  }
20802 
20803  /* "View.MemoryView":1362
20804  *
20805  * @cname('__pyx_memoryview_refcount_copying')
20806  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20807  * int ndim, bint inc) nogil:
20808  *
20809  */
20810 
20811  /* function exit code */
20812  goto __pyx_L0;
20813  __pyx_L1_error:;
20814  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20815  __pyx_L0:;
20816  __Pyx_TraceReturn(Py_None, 1);
20817 }
20818 
20819 /* "View.MemoryView":1371
20820  *
20821  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20822  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20823  * Py_ssize_t *strides, int ndim,
20824  * bint inc) with gil:
20825  */
20826 
20827 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20828  __Pyx_TraceDeclarations
20829  __Pyx_RefNannyDeclarations
20830  int __pyx_lineno = 0;
20831  const char *__pyx_filename = NULL;
20832  int __pyx_clineno = 0;
20833  #ifdef WITH_THREAD
20834  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20835  #endif
20836  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20837  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20838 
20839  /* "View.MemoryView":1374
20840  * Py_ssize_t *strides, int ndim,
20841  * bint inc) with gil:
20842  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20843  *
20844  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20845  */
20846  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20847 
20848  /* "View.MemoryView":1371
20849  *
20850  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20851  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20852  * Py_ssize_t *strides, int ndim,
20853  * bint inc) with gil:
20854  */
20855 
20856  /* function exit code */
20857  goto __pyx_L0;
20858  __pyx_L1_error:;
20859  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20860  __pyx_L0:;
20861  __Pyx_TraceReturn(Py_None, 0);
20862  __Pyx_RefNannyFinishContext();
20863  #ifdef WITH_THREAD
20864  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20865  #endif
20866 }
20867 
20868 /* "View.MemoryView":1377
20869  *
20870  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20871  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20872  * Py_ssize_t *strides, int ndim, bint inc):
20873  * cdef Py_ssize_t i
20874  */
20875 
20876 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20877  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20878  __Pyx_TraceDeclarations
20879  __Pyx_RefNannyDeclarations
20880  Py_ssize_t __pyx_t_1;
20881  Py_ssize_t __pyx_t_2;
20882  Py_ssize_t __pyx_t_3;
20883  int __pyx_t_4;
20884  int __pyx_lineno = 0;
20885  const char *__pyx_filename = NULL;
20886  int __pyx_clineno = 0;
20887  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20888  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20889 
20890  /* "View.MemoryView":1381
20891  * cdef Py_ssize_t i
20892  *
20893  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20894  * if ndim == 1:
20895  * if inc:
20896  */
20897  __pyx_t_1 = (__pyx_v_shape[0]);
20898  __pyx_t_2 = __pyx_t_1;
20899  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20900  __pyx_v_i = __pyx_t_3;
20901 
20902  /* "View.MemoryView":1382
20903  *
20904  * for i in range(shape[0]):
20905  * if ndim == 1: # <<<<<<<<<<<<<<
20906  * if inc:
20907  * Py_INCREF((<PyObject **> data)[0])
20908  */
20909  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20910  if (__pyx_t_4) {
20911 
20912  /* "View.MemoryView":1383
20913  * for i in range(shape[0]):
20914  * if ndim == 1:
20915  * if inc: # <<<<<<<<<<<<<<
20916  * Py_INCREF((<PyObject **> data)[0])
20917  * else:
20918  */
20919  __pyx_t_4 = (__pyx_v_inc != 0);
20920  if (__pyx_t_4) {
20921 
20922  /* "View.MemoryView":1384
20923  * if ndim == 1:
20924  * if inc:
20925  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20926  * else:
20927  * Py_DECREF((<PyObject **> data)[0])
20928  */
20929  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20930 
20931  /* "View.MemoryView":1383
20932  * for i in range(shape[0]):
20933  * if ndim == 1:
20934  * if inc: # <<<<<<<<<<<<<<
20935  * Py_INCREF((<PyObject **> data)[0])
20936  * else:
20937  */
20938  goto __pyx_L6;
20939  }
20940 
20941  /* "View.MemoryView":1386
20942  * Py_INCREF((<PyObject **> data)[0])
20943  * else:
20944  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20945  * else:
20946  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20947  */
20948  /*else*/ {
20949  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20950  }
20951  __pyx_L6:;
20952 
20953  /* "View.MemoryView":1382
20954  *
20955  * for i in range(shape[0]):
20956  * if ndim == 1: # <<<<<<<<<<<<<<
20957  * if inc:
20958  * Py_INCREF((<PyObject **> data)[0])
20959  */
20960  goto __pyx_L5;
20961  }
20962 
20963  /* "View.MemoryView":1388
20964  * Py_DECREF((<PyObject **> data)[0])
20965  * else:
20966  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20967  * ndim - 1, inc)
20968  *
20969  */
20970  /*else*/ {
20971 
20972  /* "View.MemoryView":1389
20973  * else:
20974  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20975  * ndim - 1, inc) # <<<<<<<<<<<<<<
20976  *
20977  * data += strides[0]
20978  */
20979  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20980  }
20981  __pyx_L5:;
20982 
20983  /* "View.MemoryView":1391
20984  * ndim - 1, inc)
20985  *
20986  * data += strides[0] # <<<<<<<<<<<<<<
20987  *
20988  *
20989  */
20990  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20991  }
20992 
20993  /* "View.MemoryView":1377
20994  *
20995  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20996  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20997  * Py_ssize_t *strides, int ndim, bint inc):
20998  * cdef Py_ssize_t i
20999  */
21000 
21001  /* function exit code */
21002  goto __pyx_L0;
21003  __pyx_L1_error:;
21004  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21005  __pyx_L0:;
21006  __Pyx_TraceReturn(Py_None, 0);
21007  __Pyx_RefNannyFinishContext();
21008 }
21009 
21010 /* "View.MemoryView":1397
21011  *
21012  * @cname('__pyx_memoryview_slice_assign_scalar')
21013  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21014  * size_t itemsize, void *item,
21015  * bint dtype_is_object) nogil:
21016  */
21017 
21018 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21019  __Pyx_TraceDeclarations
21020  int __pyx_lineno = 0;
21021  const char *__pyx_filename = NULL;
21022  int __pyx_clineno = 0;
21023  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
21024 
21025  /* "View.MemoryView":1400
21026  * size_t itemsize, void *item,
21027  * bint dtype_is_object) nogil:
21028  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21029  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21030  * itemsize, item)
21031  */
21032  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21033 
21034  /* "View.MemoryView":1401
21035  * bint dtype_is_object) nogil:
21036  * refcount_copying(dst, dtype_is_object, ndim, False)
21037  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21038  * itemsize, item)
21039  * refcount_copying(dst, dtype_is_object, ndim, True)
21040  */
21041  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21042 
21043  /* "View.MemoryView":1403
21044  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21045  * itemsize, item)
21046  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21047  *
21048  *
21049  */
21050  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21051 
21052  /* "View.MemoryView":1397
21053  *
21054  * @cname('__pyx_memoryview_slice_assign_scalar')
21055  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21056  * size_t itemsize, void *item,
21057  * bint dtype_is_object) nogil:
21058  */
21059 
21060  /* function exit code */
21061  goto __pyx_L0;
21062  __pyx_L1_error:;
21063  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21064  __pyx_L0:;
21065  __Pyx_TraceReturn(Py_None, 1);
21066 }
21067 
21068 /* "View.MemoryView":1407
21069  *
21070  * @cname('__pyx_memoryview__slice_assign_scalar')
21071  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21072  * Py_ssize_t *strides, int ndim,
21073  * size_t itemsize, void *item) nogil:
21074  */
21075 
21076 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21077  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21078  Py_ssize_t __pyx_v_stride;
21079  Py_ssize_t __pyx_v_extent;
21080  __Pyx_TraceDeclarations
21081  int __pyx_t_1;
21082  Py_ssize_t __pyx_t_2;
21083  Py_ssize_t __pyx_t_3;
21084  Py_ssize_t __pyx_t_4;
21085  int __pyx_lineno = 0;
21086  const char *__pyx_filename = NULL;
21087  int __pyx_clineno = 0;
21088  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
21089 
21090  /* "View.MemoryView":1411
21091  * size_t itemsize, void *item) nogil:
21092  * cdef Py_ssize_t i
21093  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21094  * cdef Py_ssize_t extent = shape[0]
21095  *
21096  */
21097  __pyx_v_stride = (__pyx_v_strides[0]);
21098 
21099  /* "View.MemoryView":1412
21100  * cdef Py_ssize_t i
21101  * cdef Py_ssize_t stride = strides[0]
21102  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21103  *
21104  * if ndim == 1:
21105  */
21106  __pyx_v_extent = (__pyx_v_shape[0]);
21107 
21108  /* "View.MemoryView":1414
21109  * cdef Py_ssize_t extent = shape[0]
21110  *
21111  * if ndim == 1: # <<<<<<<<<<<<<<
21112  * for i in range(extent):
21113  * memcpy(data, item, itemsize)
21114  */
21115  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21116  if (__pyx_t_1) {
21117 
21118  /* "View.MemoryView":1415
21119  *
21120  * if ndim == 1:
21121  * for i in range(extent): # <<<<<<<<<<<<<<
21122  * memcpy(data, item, itemsize)
21123  * data += stride
21124  */
21125  __pyx_t_2 = __pyx_v_extent;
21126  __pyx_t_3 = __pyx_t_2;
21127  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21128  __pyx_v_i = __pyx_t_4;
21129 
21130  /* "View.MemoryView":1416
21131  * if ndim == 1:
21132  * for i in range(extent):
21133  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21134  * data += stride
21135  * else:
21136  */
21137  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21138 
21139  /* "View.MemoryView":1417
21140  * for i in range(extent):
21141  * memcpy(data, item, itemsize)
21142  * data += stride # <<<<<<<<<<<<<<
21143  * else:
21144  * for i in range(extent):
21145  */
21146  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21147  }
21148 
21149  /* "View.MemoryView":1414
21150  * cdef Py_ssize_t extent = shape[0]
21151  *
21152  * if ndim == 1: # <<<<<<<<<<<<<<
21153  * for i in range(extent):
21154  * memcpy(data, item, itemsize)
21155  */
21156  goto __pyx_L3;
21157  }
21158 
21159  /* "View.MemoryView":1419
21160  * data += stride
21161  * else:
21162  * for i in range(extent): # <<<<<<<<<<<<<<
21163  * _slice_assign_scalar(data, shape + 1, strides + 1,
21164  * ndim - 1, itemsize, item)
21165  */
21166  /*else*/ {
21167  __pyx_t_2 = __pyx_v_extent;
21168  __pyx_t_3 = __pyx_t_2;
21169  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21170  __pyx_v_i = __pyx_t_4;
21171 
21172  /* "View.MemoryView":1420
21173  * else:
21174  * for i in range(extent):
21175  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21176  * ndim - 1, itemsize, item)
21177  * data += stride
21178  */
21179  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21180 
21181  /* "View.MemoryView":1422
21182  * _slice_assign_scalar(data, shape + 1, strides + 1,
21183  * ndim - 1, itemsize, item)
21184  * data += stride # <<<<<<<<<<<<<<
21185  *
21186  *
21187  */
21188  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21189  }
21190  }
21191  __pyx_L3:;
21192 
21193  /* "View.MemoryView":1407
21194  *
21195  * @cname('__pyx_memoryview__slice_assign_scalar')
21196  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21197  * Py_ssize_t *strides, int ndim,
21198  * size_t itemsize, void *item) nogil:
21199  */
21200 
21201  /* function exit code */
21202  goto __pyx_L0;
21203  __pyx_L1_error:;
21204  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21205  __pyx_L0:;
21206  __Pyx_TraceReturn(Py_None, 1);
21207 }
21208 
21209 /* "(tree fragment)":1
21210  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21211  * cdef object __pyx_PickleError
21212  * cdef object __pyx_result
21213  */
21214 
21215 /* Python wrapper */
21216 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21217 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21218 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21219  PyObject *__pyx_v___pyx_type = 0;
21220  long __pyx_v___pyx_checksum;
21221  PyObject *__pyx_v___pyx_state = 0;
21222  int __pyx_lineno = 0;
21223  const char *__pyx_filename = NULL;
21224  int __pyx_clineno = 0;
21225  PyObject *__pyx_r = 0;
21226  __Pyx_RefNannyDeclarations
21227  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21228  {
21229  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21230  PyObject* values[3] = {0,0,0};
21231  if (unlikely(__pyx_kwds)) {
21232  Py_ssize_t kw_args;
21233  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21234  switch (pos_args) {
21235  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21236  CYTHON_FALLTHROUGH;
21237  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21238  CYTHON_FALLTHROUGH;
21239  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21240  CYTHON_FALLTHROUGH;
21241  case 0: break;
21242  default: goto __pyx_L5_argtuple_error;
21243  }
21244  kw_args = PyDict_Size(__pyx_kwds);
21245  switch (pos_args) {
21246  case 0:
21247  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21248  else goto __pyx_L5_argtuple_error;
21249  CYTHON_FALLTHROUGH;
21250  case 1:
21251  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21252  else {
21253  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21254  }
21255  CYTHON_FALLTHROUGH;
21256  case 2:
21257  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21258  else {
21259  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21260  }
21261  }
21262  if (unlikely(kw_args > 0)) {
21263  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21264  }
21265  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21266  goto __pyx_L5_argtuple_error;
21267  } else {
21268  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21269  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21270  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21271  }
21272  __pyx_v___pyx_type = values[0];
21273  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21274  __pyx_v___pyx_state = values[2];
21275  }
21276  goto __pyx_L4_argument_unpacking_done;
21277  __pyx_L5_argtuple_error:;
21278  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21279  __pyx_L3_error:;
21280  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21281  __Pyx_RefNannyFinishContext();
21282  return NULL;
21283  __pyx_L4_argument_unpacking_done:;
21284  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21285 
21286  /* function exit code */
21287  __Pyx_RefNannyFinishContext();
21288  return __pyx_r;
21289 }
21290 
21291 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21292  PyObject *__pyx_v___pyx_PickleError = 0;
21293  PyObject *__pyx_v___pyx_result = 0;
21294  PyObject *__pyx_r = NULL;
21295  __Pyx_TraceDeclarations
21296  __Pyx_RefNannyDeclarations
21297  int __pyx_t_1;
21298  PyObject *__pyx_t_2 = NULL;
21299  PyObject *__pyx_t_3 = NULL;
21300  PyObject *__pyx_t_4 = NULL;
21301  PyObject *__pyx_t_5 = NULL;
21302  int __pyx_t_6;
21303  int __pyx_lineno = 0;
21304  const char *__pyx_filename = NULL;
21305  int __pyx_clineno = 0;
21306  __Pyx_TraceFrameInit(__pyx_codeobj__37)
21307  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21308  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21309 
21310  /* "(tree fragment)":4
21311  * cdef object __pyx_PickleError
21312  * cdef object __pyx_result
21313  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21314  * from pickle import PickleError as __pyx_PickleError
21315  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21316  */
21317  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21318  if (__pyx_t_1) {
21319 
21320  /* "(tree fragment)":5
21321  * cdef object __pyx_result
21322  * if __pyx_checksum != 0xb068931:
21323  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21324  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21325  * __pyx_result = Enum.__new__(__pyx_type)
21326  */
21327  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21328  __Pyx_GOTREF(__pyx_t_2);
21329  __Pyx_INCREF(__pyx_n_s_PickleError);
21330  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21331  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21332  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21333  __Pyx_GOTREF(__pyx_t_3);
21334  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21335  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21336  __Pyx_GOTREF(__pyx_t_2);
21337  __Pyx_INCREF(__pyx_t_2);
21338  __pyx_v___pyx_PickleError = __pyx_t_2;
21339  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21340  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21341 
21342  /* "(tree fragment)":6
21343  * if __pyx_checksum != 0xb068931:
21344  * from pickle import PickleError as __pyx_PickleError
21345  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21346  * __pyx_result = Enum.__new__(__pyx_type)
21347  * if __pyx_state is not None:
21348  */
21349  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21350  __Pyx_GOTREF(__pyx_t_2);
21351  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21352  __Pyx_GOTREF(__pyx_t_4);
21353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21354  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21355  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21356  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21357  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21358  if (likely(__pyx_t_5)) {
21359  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21360  __Pyx_INCREF(__pyx_t_5);
21361  __Pyx_INCREF(function);
21362  __Pyx_DECREF_SET(__pyx_t_2, function);
21363  }
21364  }
21365  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21366  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21367  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21368  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21369  __Pyx_GOTREF(__pyx_t_3);
21370  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21371  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21372  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21373  __PYX_ERR(1, 6, __pyx_L1_error)
21374 
21375  /* "(tree fragment)":4
21376  * cdef object __pyx_PickleError
21377  * cdef object __pyx_result
21378  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21379  * from pickle import PickleError as __pyx_PickleError
21380  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21381  */
21382  }
21383 
21384  /* "(tree fragment)":7
21385  * from pickle import PickleError as __pyx_PickleError
21386  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21387  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21388  * if __pyx_state is not None:
21389  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21390  */
21391  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21392  __Pyx_GOTREF(__pyx_t_2);
21393  __pyx_t_4 = NULL;
21394  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21395  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21396  if (likely(__pyx_t_4)) {
21397  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21398  __Pyx_INCREF(__pyx_t_4);
21399  __Pyx_INCREF(function);
21400  __Pyx_DECREF_SET(__pyx_t_2, function);
21401  }
21402  }
21403  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21404  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21405  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21406  __Pyx_GOTREF(__pyx_t_3);
21407  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21408  __pyx_v___pyx_result = __pyx_t_3;
21409  __pyx_t_3 = 0;
21410 
21411  /* "(tree fragment)":8
21412  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21413  * __pyx_result = Enum.__new__(__pyx_type)
21414  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21415  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21416  * return __pyx_result
21417  */
21418  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21419  __pyx_t_6 = (__pyx_t_1 != 0);
21420  if (__pyx_t_6) {
21421 
21422  /* "(tree fragment)":9
21423  * __pyx_result = Enum.__new__(__pyx_type)
21424  * if __pyx_state is not None:
21425  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21426  * return __pyx_result
21427  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21428  */
21429  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21430  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21431  __Pyx_GOTREF(__pyx_t_3);
21432  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21433 
21434  /* "(tree fragment)":8
21435  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21436  * __pyx_result = Enum.__new__(__pyx_type)
21437  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21438  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21439  * return __pyx_result
21440  */
21441  }
21442 
21443  /* "(tree fragment)":10
21444  * if __pyx_state is not None:
21445  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21446  * return __pyx_result # <<<<<<<<<<<<<<
21447  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21448  * __pyx_result.name = __pyx_state[0]
21449  */
21450  __Pyx_XDECREF(__pyx_r);
21451  __Pyx_INCREF(__pyx_v___pyx_result);
21452  __pyx_r = __pyx_v___pyx_result;
21453  goto __pyx_L0;
21454 
21455  /* "(tree fragment)":1
21456  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21457  * cdef object __pyx_PickleError
21458  * cdef object __pyx_result
21459  */
21460 
21461  /* function exit code */
21462  __pyx_L1_error:;
21463  __Pyx_XDECREF(__pyx_t_2);
21464  __Pyx_XDECREF(__pyx_t_3);
21465  __Pyx_XDECREF(__pyx_t_4);
21466  __Pyx_XDECREF(__pyx_t_5);
21467  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21468  __pyx_r = NULL;
21469  __pyx_L0:;
21470  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21471  __Pyx_XDECREF(__pyx_v___pyx_result);
21472  __Pyx_XGIVEREF(__pyx_r);
21473  __Pyx_TraceReturn(__pyx_r, 0);
21474  __Pyx_RefNannyFinishContext();
21475  return __pyx_r;
21476 }
21477 
21478 /* "(tree fragment)":11
21479  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21480  * return __pyx_result
21481  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21482  * __pyx_result.name = __pyx_state[0]
21483  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21484  */
21485 
21486 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21487  PyObject *__pyx_r = NULL;
21488  __Pyx_TraceDeclarations
21489  __Pyx_RefNannyDeclarations
21490  PyObject *__pyx_t_1 = NULL;
21491  int __pyx_t_2;
21492  Py_ssize_t __pyx_t_3;
21493  int __pyx_t_4;
21494  int __pyx_t_5;
21495  PyObject *__pyx_t_6 = NULL;
21496  PyObject *__pyx_t_7 = NULL;
21497  PyObject *__pyx_t_8 = NULL;
21498  int __pyx_lineno = 0;
21499  const char *__pyx_filename = NULL;
21500  int __pyx_clineno = 0;
21501  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21502  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21503 
21504  /* "(tree fragment)":12
21505  * return __pyx_result
21506  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21507  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21508  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21509  * __pyx_result.__dict__.update(__pyx_state[1])
21510  */
21511  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21512  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21513  __PYX_ERR(1, 12, __pyx_L1_error)
21514  }
21515  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21516  __Pyx_GOTREF(__pyx_t_1);
21517  __Pyx_GIVEREF(__pyx_t_1);
21518  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21519  __Pyx_DECREF(__pyx_v___pyx_result->name);
21520  __pyx_v___pyx_result->name = __pyx_t_1;
21521  __pyx_t_1 = 0;
21522 
21523  /* "(tree fragment)":13
21524  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21525  * __pyx_result.name = __pyx_state[0]
21526  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21527  * __pyx_result.__dict__.update(__pyx_state[1])
21528  */
21529  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21530  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21531  __PYX_ERR(1, 13, __pyx_L1_error)
21532  }
21533  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21534  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21535  if (__pyx_t_4) {
21536  } else {
21537  __pyx_t_2 = __pyx_t_4;
21538  goto __pyx_L4_bool_binop_done;
21539  }
21540  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21541  __pyx_t_5 = (__pyx_t_4 != 0);
21542  __pyx_t_2 = __pyx_t_5;
21543  __pyx_L4_bool_binop_done:;
21544  if (__pyx_t_2) {
21545 
21546  /* "(tree fragment)":14
21547  * __pyx_result.name = __pyx_state[0]
21548  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21549  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21550  */
21551  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21552  __Pyx_GOTREF(__pyx_t_6);
21553  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21554  __Pyx_GOTREF(__pyx_t_7);
21555  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21556  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21557  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21558  __PYX_ERR(1, 14, __pyx_L1_error)
21559  }
21560  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21561  __Pyx_GOTREF(__pyx_t_6);
21562  __pyx_t_8 = NULL;
21563  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21564  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21565  if (likely(__pyx_t_8)) {
21566  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21567  __Pyx_INCREF(__pyx_t_8);
21568  __Pyx_INCREF(function);
21569  __Pyx_DECREF_SET(__pyx_t_7, function);
21570  }
21571  }
21572  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21573  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21574  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21575  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21576  __Pyx_GOTREF(__pyx_t_1);
21577  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21578  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21579 
21580  /* "(tree fragment)":13
21581  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21582  * __pyx_result.name = __pyx_state[0]
21583  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21584  * __pyx_result.__dict__.update(__pyx_state[1])
21585  */
21586  }
21587 
21588  /* "(tree fragment)":11
21589  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21590  * return __pyx_result
21591  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21592  * __pyx_result.name = __pyx_state[0]
21593  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21594  */
21595 
21596  /* function exit code */
21597  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21598  goto __pyx_L0;
21599  __pyx_L1_error:;
21600  __Pyx_XDECREF(__pyx_t_1);
21601  __Pyx_XDECREF(__pyx_t_6);
21602  __Pyx_XDECREF(__pyx_t_7);
21603  __Pyx_XDECREF(__pyx_t_8);
21604  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21605  __pyx_r = 0;
21606  __pyx_L0:;
21607  __Pyx_XGIVEREF(__pyx_r);
21608  __Pyx_TraceReturn(__pyx_r, 0);
21609  __Pyx_RefNannyFinishContext();
21610  return __pyx_r;
21611 }
21612 
21613 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21614  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21615  PyObject *o;
21616  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21617  o = (*t->tp_alloc)(t, 0);
21618  } else {
21619  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21620  }
21621  if (unlikely(!o)) return 0;
21622  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21623  p->Shape = Py_None; Py_INCREF(Py_None);
21624  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21625  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21626  p->ct = Py_None; Py_INCREF(Py_None);
21627  p->_b_or.data = NULL;
21628  p->_b_or.memview = NULL;
21629  return o;
21630 }
21631 
21632 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21633  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21634  #if CYTHON_USE_TP_FINALIZE
21635  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21636  if (PyObject_CallFinalizerFromDealloc(o)) return;
21637  }
21638  #endif
21639  PyObject_GC_UnTrack(o);
21640  Py_CLEAR(p->Shape);
21641  Py_CLEAR(p->name);
21642  Py_CLEAR(p->BC_type);
21643  Py_CLEAR(p->ct);
21644  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21645  (*Py_TYPE(o)->tp_free)(o);
21646 }
21647 
21648 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
21649  int e;
21650  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21651  if (p->Shape) {
21652  e = (*v)(p->Shape, a); if (e) return e;
21653  }
21654  if (p->ct) {
21655  e = (*v)(p->ct, a); if (e) return e;
21656  }
21657  return 0;
21658 }
21659 
21660 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21661  PyObject* tmp;
21662  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21663  tmp = ((PyObject*)p->Shape);
21664  p->Shape = Py_None; Py_INCREF(Py_None);
21665  Py_XDECREF(tmp);
21666  tmp = ((PyObject*)p->ct);
21667  p->ct = Py_None; Py_INCREF(Py_None);
21668  Py_XDECREF(tmp);
21669  return 0;
21670 }
21671 
21672 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
21673  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21674 }
21675 
21676 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21677  if (v) {
21678  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
21679  }
21680  else {
21681  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21682  return -1;
21683  }
21684 }
21685 
21686 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
21687  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21688 }
21689 
21690 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21691  if (v) {
21692  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
21693  }
21694  else {
21695  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21696  }
21697 }
21698 
21699 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
21700  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21701 }
21702 
21703 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21704  if (v) {
21705  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
21706  }
21707  else {
21708  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21709  }
21710 }
21711 
21712 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
21713  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21714 }
21715 
21716 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21717  if (v) {
21718  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
21719  }
21720  else {
21721  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21722  }
21723 }
21724 
21725 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
21726  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21727 }
21728 
21729 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21730  if (v) {
21731  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
21732  }
21733  else {
21734  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21735  }
21736 }
21737 
21738 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21739  {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21740  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21741  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21742  {0, 0, 0, 0}
21743 };
21744 
21745 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21746  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)"nd: 'int'", 0},
21747  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)"Shape: object", 0},
21748  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)"name: str", 0},
21749  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)"BC_type: str", 0},
21750  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)"ct: object", 0},
21751  {0, 0, 0, 0, 0}
21752 };
21753 
21754 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21755  PyVarObject_HEAD_INIT(0, 0)
21756  "BoundaryConditions.BC_Base", /*tp_name*/
21757  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
21758  0, /*tp_itemsize*/
21759  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
21760  #if PY_VERSION_HEX < 0x030800b4
21761  0, /*tp_print*/
21762  #endif
21763  #if PY_VERSION_HEX >= 0x030800b4
21764  0, /*tp_vectorcall_offset*/
21765  #endif
21766  0, /*tp_getattr*/
21767  0, /*tp_setattr*/
21768  #if PY_MAJOR_VERSION < 3
21769  0, /*tp_compare*/
21770  #endif
21771  #if PY_MAJOR_VERSION >= 3
21772  0, /*tp_as_async*/
21773  #endif
21774  0, /*tp_repr*/
21775  0, /*tp_as_number*/
21776  0, /*tp_as_sequence*/
21777  0, /*tp_as_mapping*/
21778  0, /*tp_hash*/
21779  0, /*tp_call*/
21780  0, /*tp_str*/
21781  0, /*tp_getattro*/
21782  0, /*tp_setattro*/
21783  0, /*tp_as_buffer*/
21784  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21785  "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
21786  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
21787  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
21788  0, /*tp_richcompare*/
21789  0, /*tp_weaklistoffset*/
21790  0, /*tp_iter*/
21791  0, /*tp_iternext*/
21792  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
21793  0, /*tp_members*/
21794  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
21795  0, /*tp_base*/
21796  0, /*tp_dict*/
21797  0, /*tp_descr_get*/
21798  0, /*tp_descr_set*/
21799  0, /*tp_dictoffset*/
21800  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
21801  0, /*tp_alloc*/
21802  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
21803  0, /*tp_free*/
21804  0, /*tp_is_gc*/
21805  0, /*tp_bases*/
21806  0, /*tp_mro*/
21807  0, /*tp_cache*/
21808  0, /*tp_subclasses*/
21809  0, /*tp_weaklist*/
21810  0, /*tp_del*/
21811  0, /*tp_version_tag*/
21812  #if PY_VERSION_HEX >= 0x030400a1
21813  0, /*tp_finalize*/
21814  #endif
21815  #if PY_VERSION_HEX >= 0x030800b1
21816  0, /*tp_vectorcall*/
21817  #endif
21818  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21819  0, /*tp_print*/
21820  #endif
21821 };
21822 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21823 
21824 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21825  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21826  PyObject *o;
21827  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21828  o = (*t->tp_alloc)(t, 0);
21829  } else {
21830  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21831  }
21832  if (unlikely(!o)) return 0;
21833  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21834  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21835  p->uOfXT = Py_None; Py_INCREF(Py_None);
21836  return o;
21837 }
21838 
21839 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21840  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21841  #if CYTHON_USE_TP_FINALIZE
21842  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21843  if (PyObject_CallFinalizerFromDealloc(o)) return;
21844  }
21845  #endif
21846  PyObject_GC_UnTrack(o);
21847  Py_CLEAR(p->uOfXT);
21848  (*Py_TYPE(o)->tp_free)(o);
21849 }
21850 
21851 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
21852  int e;
21853  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21854  if (p->uOfXT) {
21855  e = (*v)(p->uOfXT, a); if (e) return e;
21856  }
21857  return 0;
21858 }
21859 
21860 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21861  PyObject* tmp;
21862  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21863  tmp = ((PyObject*)p->uOfXT);
21864  p->uOfXT = Py_None; Py_INCREF(Py_None);
21865  Py_XDECREF(tmp);
21866  return 0;
21867 }
21868 
21869 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
21870  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21871 }
21872 
21873 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21874  if (v) {
21875  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21876  }
21877  else {
21878  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21879  }
21880 }
21881 
21882 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21883  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21884  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21885  {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21886  {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21887  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21888  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21889  {0, 0, 0, 0}
21890 };
21891 
21892 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21893  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)"uOfXT: object", 0},
21894  {0, 0, 0, 0, 0}
21895 };
21896 
21897 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21898  PyVarObject_HEAD_INIT(0, 0)
21899  "BoundaryConditions.BoundaryCondition", /*tp_name*/
21900  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
21901  0, /*tp_itemsize*/
21902  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
21903  #if PY_VERSION_HEX < 0x030800b4
21904  0, /*tp_print*/
21905  #endif
21906  #if PY_VERSION_HEX >= 0x030800b4
21907  0, /*tp_vectorcall_offset*/
21908  #endif
21909  0, /*tp_getattr*/
21910  0, /*tp_setattr*/
21911  #if PY_MAJOR_VERSION < 3
21912  0, /*tp_compare*/
21913  #endif
21914  #if PY_MAJOR_VERSION >= 3
21915  0, /*tp_as_async*/
21916  #endif
21917  0, /*tp_repr*/
21918  0, /*tp_as_number*/
21919  0, /*tp_as_sequence*/
21920  0, /*tp_as_mapping*/
21921  0, /*tp_hash*/
21922  0, /*tp_call*/
21923  0, /*tp_str*/
21924  0, /*tp_getattro*/
21925  0, /*tp_setattro*/
21926  0, /*tp_as_buffer*/
21927  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21928  "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
21929  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
21930  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
21931  0, /*tp_richcompare*/
21932  0, /*tp_weaklistoffset*/
21933  0, /*tp_iter*/
21934  0, /*tp_iternext*/
21935  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
21936  0, /*tp_members*/
21937  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
21938  0, /*tp_base*/
21939  0, /*tp_dict*/
21940  0, /*tp_descr_get*/
21941  0, /*tp_descr_set*/
21942  0, /*tp_dictoffset*/
21943  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
21944  0, /*tp_alloc*/
21945  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
21946  0, /*tp_free*/
21947  0, /*tp_is_gc*/
21948  0, /*tp_bases*/
21949  0, /*tp_mro*/
21950  0, /*tp_cache*/
21951  0, /*tp_subclasses*/
21952  0, /*tp_weaklist*/
21953  0, /*tp_del*/
21954  0, /*tp_version_tag*/
21955  #if PY_VERSION_HEX >= 0x030400a1
21956  0, /*tp_finalize*/
21957  #endif
21958  #if PY_VERSION_HEX >= 0x030800b1
21959  0, /*tp_vectorcall*/
21960  #endif
21961  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21962  0, /*tp_print*/
21963  #endif
21964 };
21965 
21966 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21967 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21968 
21969 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21970  PyObject *o;
21971  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21972  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21973  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21974  (void) PyObject_INIT(o, t);
21975  PyObject_GC_Track(o);
21976  } else {
21977  o = (*t->tp_alloc)(t, 0);
21978  if (unlikely(!o)) return 0;
21979  }
21980  return o;
21981 }
21982 
21983 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21984  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21985  PyObject_GC_UnTrack(o);
21986  Py_CLEAR(p->__pyx_v_value);
21987  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21988  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21989  } else {
21990  (*Py_TYPE(o)->tp_free)(o);
21991  }
21992 }
21993 
21994 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
21995  int e;
21996  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21997  if (p->__pyx_v_value) {
21998  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21999  }
22000  return 0;
22001 }
22002 
22003 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22004  PyObject* tmp;
22005  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22006  tmp = ((PyObject*)p->__pyx_v_value);
22007  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22008  Py_XDECREF(tmp);
22009  return 0;
22010 }
22011 
22012 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
22013  PyVarObject_HEAD_INIT(0, 0)
22014  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
22015  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
22016  0, /*tp_itemsize*/
22017  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
22018  #if PY_VERSION_HEX < 0x030800b4
22019  0, /*tp_print*/
22020  #endif
22021  #if PY_VERSION_HEX >= 0x030800b4
22022  0, /*tp_vectorcall_offset*/
22023  #endif
22024  0, /*tp_getattr*/
22025  0, /*tp_setattr*/
22026  #if PY_MAJOR_VERSION < 3
22027  0, /*tp_compare*/
22028  #endif
22029  #if PY_MAJOR_VERSION >= 3
22030  0, /*tp_as_async*/
22031  #endif
22032  0, /*tp_repr*/
22033  0, /*tp_as_number*/
22034  0, /*tp_as_sequence*/
22035  0, /*tp_as_mapping*/
22036  0, /*tp_hash*/
22037  0, /*tp_call*/
22038  0, /*tp_str*/
22039  0, /*tp_getattro*/
22040  0, /*tp_setattro*/
22041  0, /*tp_as_buffer*/
22042  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22043  0, /*tp_doc*/
22044  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
22045  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
22046  0, /*tp_richcompare*/
22047  0, /*tp_weaklistoffset*/
22048  0, /*tp_iter*/
22049  0, /*tp_iternext*/
22050  0, /*tp_methods*/
22051  0, /*tp_members*/
22052  0, /*tp_getset*/
22053  0, /*tp_base*/
22054  0, /*tp_dict*/
22055  0, /*tp_descr_get*/
22056  0, /*tp_descr_set*/
22057  0, /*tp_dictoffset*/
22058  0, /*tp_init*/
22059  0, /*tp_alloc*/
22060  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
22061  0, /*tp_free*/
22062  0, /*tp_is_gc*/
22063  0, /*tp_bases*/
22064  0, /*tp_mro*/
22065  0, /*tp_cache*/
22066  0, /*tp_subclasses*/
22067  0, /*tp_weaklist*/
22068  0, /*tp_del*/
22069  0, /*tp_version_tag*/
22070  #if PY_VERSION_HEX >= 0x030400a1
22071  0, /*tp_finalize*/
22072  #endif
22073  #if PY_VERSION_HEX >= 0x030800b1
22074  0, /*tp_vectorcall*/
22075  #endif
22076  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22077  0, /*tp_print*/
22078  #endif
22079 };
22080 
22081 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
22082 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
22083 
22084 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22085  PyObject *o;
22086  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22087  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
22088  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
22089  (void) PyObject_INIT(o, t);
22090  PyObject_GC_Track(o);
22091  } else {
22092  o = (*t->tp_alloc)(t, 0);
22093  if (unlikely(!o)) return 0;
22094  }
22095  return o;
22096 }
22097 
22098 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22099  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22100  PyObject_GC_UnTrack(o);
22101  Py_CLEAR(p->__pyx_v_a);
22102  Py_CLEAR(p->__pyx_v_a0);
22103  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22104  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
22105  } else {
22106  (*Py_TYPE(o)->tp_free)(o);
22107  }
22108 }
22109 
22110 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
22111  int e;
22112  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22113  if (p->__pyx_v_a) {
22114  e = (*v)(p->__pyx_v_a, a); if (e) return e;
22115  }
22116  if (p->__pyx_v_a0) {
22117  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
22118  }
22119  return 0;
22120 }
22121 
22122 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22123  PyObject* tmp;
22124  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22125  tmp = ((PyObject*)p->__pyx_v_a);
22126  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
22127  Py_XDECREF(tmp);
22128  tmp = ((PyObject*)p->__pyx_v_a0);
22129  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
22130  Py_XDECREF(tmp);
22131  return 0;
22132 }
22133 
22134 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
22135  PyVarObject_HEAD_INIT(0, 0)
22136  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
22137  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
22138  0, /*tp_itemsize*/
22139  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
22140  #if PY_VERSION_HEX < 0x030800b4
22141  0, /*tp_print*/
22142  #endif
22143  #if PY_VERSION_HEX >= 0x030800b4
22144  0, /*tp_vectorcall_offset*/
22145  #endif
22146  0, /*tp_getattr*/
22147  0, /*tp_setattr*/
22148  #if PY_MAJOR_VERSION < 3
22149  0, /*tp_compare*/
22150  #endif
22151  #if PY_MAJOR_VERSION >= 3
22152  0, /*tp_as_async*/
22153  #endif
22154  0, /*tp_repr*/
22155  0, /*tp_as_number*/
22156  0, /*tp_as_sequence*/
22157  0, /*tp_as_mapping*/
22158  0, /*tp_hash*/
22159  0, /*tp_call*/
22160  0, /*tp_str*/
22161  0, /*tp_getattro*/
22162  0, /*tp_setattro*/
22163  0, /*tp_as_buffer*/
22164  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22165  0, /*tp_doc*/
22166  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
22167  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
22168  0, /*tp_richcompare*/
22169  0, /*tp_weaklistoffset*/
22170  0, /*tp_iter*/
22171  0, /*tp_iternext*/
22172  0, /*tp_methods*/
22173  0, /*tp_members*/
22174  0, /*tp_getset*/
22175  0, /*tp_base*/
22176  0, /*tp_dict*/
22177  0, /*tp_descr_get*/
22178  0, /*tp_descr_set*/
22179  0, /*tp_dictoffset*/
22180  0, /*tp_init*/
22181  0, /*tp_alloc*/
22182  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
22183  0, /*tp_free*/
22184  0, /*tp_is_gc*/
22185  0, /*tp_bases*/
22186  0, /*tp_mro*/
22187  0, /*tp_cache*/
22188  0, /*tp_subclasses*/
22189  0, /*tp_weaklist*/
22190  0, /*tp_del*/
22191  0, /*tp_version_tag*/
22192  #if PY_VERSION_HEX >= 0x030400a1
22193  0, /*tp_finalize*/
22194  #endif
22195  #if PY_VERSION_HEX >= 0x030800b1
22196  0, /*tp_vectorcall*/
22197  #endif
22198  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22199  0, /*tp_print*/
22200  #endif
22201 };
22202 
22203 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
22204 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
22205 
22206 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22207  PyObject *o;
22208  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22209  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
22210  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
22211  (void) PyObject_INIT(o, t);
22212  PyObject_GC_Track(o);
22213  } else {
22214  o = (*t->tp_alloc)(t, 0);
22215  if (unlikely(!o)) return 0;
22216  }
22217  return o;
22218 }
22219 
22220 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22221  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22222  PyObject_GC_UnTrack(o);
22223  Py_CLEAR(p->__pyx_v_t1);
22224  Py_CLEAR(p->__pyx_v_value);
22225  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22226  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
22227  } else {
22228  (*Py_TYPE(o)->tp_free)(o);
22229  }
22230 }
22231 
22232 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc v, void *a) {
22233  int e;
22234  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22235  if (p->__pyx_v_t1) {
22236  e = (*v)(p->__pyx_v_t1, a); if (e) return e;
22237  }
22238  if (p->__pyx_v_value) {
22239  e = (*v)(p->__pyx_v_value, a); if (e) return e;
22240  }
22241  return 0;
22242 }
22243 
22244 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22245  PyObject* tmp;
22246  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22247  tmp = ((PyObject*)p->__pyx_v_t1);
22248  p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
22249  Py_XDECREF(tmp);
22250  tmp = ((PyObject*)p->__pyx_v_value);
22251  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22252  Py_XDECREF(tmp);
22253  return 0;
22254 }
22255 
22256 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
22257  PyVarObject_HEAD_INIT(0, 0)
22258  "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp", /*tp_name*/
22259  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp), /*tp_basicsize*/
22260  0, /*tp_itemsize*/
22261  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_dealloc*/
22262  #if PY_VERSION_HEX < 0x030800b4
22263  0, /*tp_print*/
22264  #endif
22265  #if PY_VERSION_HEX >= 0x030800b4
22266  0, /*tp_vectorcall_offset*/
22267  #endif
22268  0, /*tp_getattr*/
22269  0, /*tp_setattr*/
22270  #if PY_MAJOR_VERSION < 3
22271  0, /*tp_compare*/
22272  #endif
22273  #if PY_MAJOR_VERSION >= 3
22274  0, /*tp_as_async*/
22275  #endif
22276  0, /*tp_repr*/
22277  0, /*tp_as_number*/
22278  0, /*tp_as_sequence*/
22279  0, /*tp_as_mapping*/
22280  0, /*tp_hash*/
22281  0, /*tp_call*/
22282  0, /*tp_str*/
22283  0, /*tp_getattro*/
22284  0, /*tp_setattro*/
22285  0, /*tp_as_buffer*/
22286  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22287  0, /*tp_doc*/
22288  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_traverse*/
22289  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_clear*/
22290  0, /*tp_richcompare*/
22291  0, /*tp_weaklistoffset*/
22292  0, /*tp_iter*/
22293  0, /*tp_iternext*/
22294  0, /*tp_methods*/
22295  0, /*tp_members*/
22296  0, /*tp_getset*/
22297  0, /*tp_base*/
22298  0, /*tp_dict*/
22299  0, /*tp_descr_get*/
22300  0, /*tp_descr_set*/
22301  0, /*tp_dictoffset*/
22302  0, /*tp_init*/
22303  0, /*tp_alloc*/
22304  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_new*/
22305  0, /*tp_free*/
22306  0, /*tp_is_gc*/
22307  0, /*tp_bases*/
22308  0, /*tp_mro*/
22309  0, /*tp_cache*/
22310  0, /*tp_subclasses*/
22311  0, /*tp_weaklist*/
22312  0, /*tp_del*/
22313  0, /*tp_version_tag*/
22314  #if PY_VERSION_HEX >= 0x030400a1
22315  0, /*tp_finalize*/
22316  #endif
22317  #if PY_VERSION_HEX >= 0x030800b1
22318  0, /*tp_vectorcall*/
22319  #endif
22320  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22321  0, /*tp_print*/
22322  #endif
22323 };
22324 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22325 
22326 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22327  struct __pyx_array_obj *p;
22328  PyObject *o;
22329  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22330  o = (*t->tp_alloc)(t, 0);
22331  } else {
22332  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22333  }
22334  if (unlikely(!o)) return 0;
22335  p = ((struct __pyx_array_obj *)o);
22336  p->__pyx_vtab = __pyx_vtabptr_array;
22337  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22338  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22339  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22340  return o;
22341  bad:
22342  Py_DECREF(o); o = 0;
22343  return NULL;
22344 }
22345 
22346 static void __pyx_tp_dealloc_array(PyObject *o) {
22347  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22348  #if CYTHON_USE_TP_FINALIZE
22349  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22350  if (PyObject_CallFinalizerFromDealloc(o)) return;
22351  }
22352  #endif
22353  {
22354  PyObject *etype, *eval, *etb;
22355  PyErr_Fetch(&etype, &eval, &etb);
22356  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22357  __pyx_array___dealloc__(o);
22358  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22359  PyErr_Restore(etype, eval, etb);
22360  }
22361  Py_CLEAR(p->mode);
22362  Py_CLEAR(p->_format);
22363  (*Py_TYPE(o)->tp_free)(o);
22364 }
22365 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22366  PyObject *r;
22367  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22368  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22369  Py_DECREF(x);
22370  return r;
22371 }
22372 
22373 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22374  if (v) {
22375  return __pyx_array___setitem__(o, i, v);
22376  }
22377  else {
22378  PyErr_Format(PyExc_NotImplementedError,
22379  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22380  return -1;
22381  }
22382 }
22383 
22384 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22385  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22386  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22387  PyErr_Clear();
22388  v = __pyx_array___getattr__(o, n);
22389  }
22390  return v;
22391 }
22392 
22393 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22394  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22395 }
22396 
22397 static PyMethodDef __pyx_methods_array[] = {
22398  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22399  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22400  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22401  {0, 0, 0, 0}
22402 };
22403 
22404 static struct PyGetSetDef __pyx_getsets_array[] = {
22405  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22406  {0, 0, 0, 0, 0}
22407 };
22408 
22409 static PySequenceMethods __pyx_tp_as_sequence_array = {
22410  __pyx_array___len__, /*sq_length*/
22411  0, /*sq_concat*/
22412  0, /*sq_repeat*/
22413  __pyx_sq_item_array, /*sq_item*/
22414  0, /*sq_slice*/
22415  0, /*sq_ass_item*/
22416  0, /*sq_ass_slice*/
22417  0, /*sq_contains*/
22418  0, /*sq_inplace_concat*/
22419  0, /*sq_inplace_repeat*/
22420 };
22421 
22422 static PyMappingMethods __pyx_tp_as_mapping_array = {
22423  __pyx_array___len__, /*mp_length*/
22424  __pyx_array___getitem__, /*mp_subscript*/
22425  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22426 };
22427 
22428 static PyBufferProcs __pyx_tp_as_buffer_array = {
22429  #if PY_MAJOR_VERSION < 3
22430  0, /*bf_getreadbuffer*/
22431  #endif
22432  #if PY_MAJOR_VERSION < 3
22433  0, /*bf_getwritebuffer*/
22434  #endif
22435  #if PY_MAJOR_VERSION < 3
22436  0, /*bf_getsegcount*/
22437  #endif
22438  #if PY_MAJOR_VERSION < 3
22439  0, /*bf_getcharbuffer*/
22440  #endif
22441  __pyx_array_getbuffer, /*bf_getbuffer*/
22442  0, /*bf_releasebuffer*/
22443 };
22444 
22445 static PyTypeObject __pyx_type___pyx_array = {
22446  PyVarObject_HEAD_INIT(0, 0)
22447  "BoundaryConditions.array", /*tp_name*/
22448  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22449  0, /*tp_itemsize*/
22450  __pyx_tp_dealloc_array, /*tp_dealloc*/
22451  #if PY_VERSION_HEX < 0x030800b4
22452  0, /*tp_print*/
22453  #endif
22454  #if PY_VERSION_HEX >= 0x030800b4
22455  0, /*tp_vectorcall_offset*/
22456  #endif
22457  0, /*tp_getattr*/
22458  0, /*tp_setattr*/
22459  #if PY_MAJOR_VERSION < 3
22460  0, /*tp_compare*/
22461  #endif
22462  #if PY_MAJOR_VERSION >= 3
22463  0, /*tp_as_async*/
22464  #endif
22465  0, /*tp_repr*/
22466  0, /*tp_as_number*/
22467  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22468  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22469  0, /*tp_hash*/
22470  0, /*tp_call*/
22471  0, /*tp_str*/
22472  __pyx_tp_getattro_array, /*tp_getattro*/
22473  0, /*tp_setattro*/
22474  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22475  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22476  0, /*tp_doc*/
22477  0, /*tp_traverse*/
22478  0, /*tp_clear*/
22479  0, /*tp_richcompare*/
22480  0, /*tp_weaklistoffset*/
22481  0, /*tp_iter*/
22482  0, /*tp_iternext*/
22483  __pyx_methods_array, /*tp_methods*/
22484  0, /*tp_members*/
22485  __pyx_getsets_array, /*tp_getset*/
22486  0, /*tp_base*/
22487  0, /*tp_dict*/
22488  0, /*tp_descr_get*/
22489  0, /*tp_descr_set*/
22490  0, /*tp_dictoffset*/
22491  0, /*tp_init*/
22492  0, /*tp_alloc*/
22493  __pyx_tp_new_array, /*tp_new*/
22494  0, /*tp_free*/
22495  0, /*tp_is_gc*/
22496  0, /*tp_bases*/
22497  0, /*tp_mro*/
22498  0, /*tp_cache*/
22499  0, /*tp_subclasses*/
22500  0, /*tp_weaklist*/
22501  0, /*tp_del*/
22502  0, /*tp_version_tag*/
22503  #if PY_VERSION_HEX >= 0x030400a1
22504  0, /*tp_finalize*/
22505  #endif
22506  #if PY_VERSION_HEX >= 0x030800b1
22507  0, /*tp_vectorcall*/
22508  #endif
22509  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22510  0, /*tp_print*/
22511  #endif
22512 };
22513 
22514 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22515  struct __pyx_MemviewEnum_obj *p;
22516  PyObject *o;
22517  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22518  o = (*t->tp_alloc)(t, 0);
22519  } else {
22520  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22521  }
22522  if (unlikely(!o)) return 0;
22523  p = ((struct __pyx_MemviewEnum_obj *)o);
22524  p->name = Py_None; Py_INCREF(Py_None);
22525  return o;
22526 }
22527 
22528 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22529  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22530  #if CYTHON_USE_TP_FINALIZE
22531  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22532  if (PyObject_CallFinalizerFromDealloc(o)) return;
22533  }
22534  #endif
22535  PyObject_GC_UnTrack(o);
22536  Py_CLEAR(p->name);
22537  (*Py_TYPE(o)->tp_free)(o);
22538 }
22539 
22540 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22541  int e;
22542  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22543  if (p->name) {
22544  e = (*v)(p->name, a); if (e) return e;
22545  }
22546  return 0;
22547 }
22548 
22549 static int __pyx_tp_clear_Enum(PyObject *o) {
22550  PyObject* tmp;
22551  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22552  tmp = ((PyObject*)p->name);
22553  p->name = Py_None; Py_INCREF(Py_None);
22554  Py_XDECREF(tmp);
22555  return 0;
22556 }
22557 
22558 static PyMethodDef __pyx_methods_Enum[] = {
22559  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22560  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22561  {0, 0, 0, 0}
22562 };
22563 
22564 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22565  PyVarObject_HEAD_INIT(0, 0)
22566  "BoundaryConditions.Enum", /*tp_name*/
22567  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22568  0, /*tp_itemsize*/
22569  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22570  #if PY_VERSION_HEX < 0x030800b4
22571  0, /*tp_print*/
22572  #endif
22573  #if PY_VERSION_HEX >= 0x030800b4
22574  0, /*tp_vectorcall_offset*/
22575  #endif
22576  0, /*tp_getattr*/
22577  0, /*tp_setattr*/
22578  #if PY_MAJOR_VERSION < 3
22579  0, /*tp_compare*/
22580  #endif
22581  #if PY_MAJOR_VERSION >= 3
22582  0, /*tp_as_async*/
22583  #endif
22584  __pyx_MemviewEnum___repr__, /*tp_repr*/
22585  0, /*tp_as_number*/
22586  0, /*tp_as_sequence*/
22587  0, /*tp_as_mapping*/
22588  0, /*tp_hash*/
22589  0, /*tp_call*/
22590  0, /*tp_str*/
22591  0, /*tp_getattro*/
22592  0, /*tp_setattro*/
22593  0, /*tp_as_buffer*/
22594  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22595  0, /*tp_doc*/
22596  __pyx_tp_traverse_Enum, /*tp_traverse*/
22597  __pyx_tp_clear_Enum, /*tp_clear*/
22598  0, /*tp_richcompare*/
22599  0, /*tp_weaklistoffset*/
22600  0, /*tp_iter*/
22601  0, /*tp_iternext*/
22602  __pyx_methods_Enum, /*tp_methods*/
22603  0, /*tp_members*/
22604  0, /*tp_getset*/
22605  0, /*tp_base*/
22606  0, /*tp_dict*/
22607  0, /*tp_descr_get*/
22608  0, /*tp_descr_set*/
22609  0, /*tp_dictoffset*/
22610  __pyx_MemviewEnum___init__, /*tp_init*/
22611  0, /*tp_alloc*/
22612  __pyx_tp_new_Enum, /*tp_new*/
22613  0, /*tp_free*/
22614  0, /*tp_is_gc*/
22615  0, /*tp_bases*/
22616  0, /*tp_mro*/
22617  0, /*tp_cache*/
22618  0, /*tp_subclasses*/
22619  0, /*tp_weaklist*/
22620  0, /*tp_del*/
22621  0, /*tp_version_tag*/
22622  #if PY_VERSION_HEX >= 0x030400a1
22623  0, /*tp_finalize*/
22624  #endif
22625  #if PY_VERSION_HEX >= 0x030800b1
22626  0, /*tp_vectorcall*/
22627  #endif
22628  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22629  0, /*tp_print*/
22630  #endif
22631 };
22632 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22633 
22634 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22635  struct __pyx_memoryview_obj *p;
22636  PyObject *o;
22637  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22638  o = (*t->tp_alloc)(t, 0);
22639  } else {
22640  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22641  }
22642  if (unlikely(!o)) return 0;
22643  p = ((struct __pyx_memoryview_obj *)o);
22644  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22645  p->obj = Py_None; Py_INCREF(Py_None);
22646  p->_size = Py_None; Py_INCREF(Py_None);
22647  p->_array_interface = Py_None; Py_INCREF(Py_None);
22648  p->view.obj = NULL;
22649  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22650  return o;
22651  bad:
22652  Py_DECREF(o); o = 0;
22653  return NULL;
22654 }
22655 
22656 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22657  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22658  #if CYTHON_USE_TP_FINALIZE
22659  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22660  if (PyObject_CallFinalizerFromDealloc(o)) return;
22661  }
22662  #endif
22663  PyObject_GC_UnTrack(o);
22664  {
22665  PyObject *etype, *eval, *etb;
22666  PyErr_Fetch(&etype, &eval, &etb);
22667  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22668  __pyx_memoryview___dealloc__(o);
22669  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22670  PyErr_Restore(etype, eval, etb);
22671  }
22672  Py_CLEAR(p->obj);
22673  Py_CLEAR(p->_size);
22674  Py_CLEAR(p->_array_interface);
22675  (*Py_TYPE(o)->tp_free)(o);
22676 }
22677 
22678 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22679  int e;
22680  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22681  if (p->obj) {
22682  e = (*v)(p->obj, a); if (e) return e;
22683  }
22684  if (p->_size) {
22685  e = (*v)(p->_size, a); if (e) return e;
22686  }
22687  if (p->_array_interface) {
22688  e = (*v)(p->_array_interface, a); if (e) return e;
22689  }
22690  if (p->view.obj) {
22691  e = (*v)(p->view.obj, a); if (e) return e;
22692  }
22693  return 0;
22694 }
22695 
22696 static int __pyx_tp_clear_memoryview(PyObject *o) {
22697  PyObject* tmp;
22698  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22699  tmp = ((PyObject*)p->obj);
22700  p->obj = Py_None; Py_INCREF(Py_None);
22701  Py_XDECREF(tmp);
22702  tmp = ((PyObject*)p->_size);
22703  p->_size = Py_None; Py_INCREF(Py_None);
22704  Py_XDECREF(tmp);
22705  tmp = ((PyObject*)p->_array_interface);
22706  p->_array_interface = Py_None; Py_INCREF(Py_None);
22707  Py_XDECREF(tmp);
22708  Py_CLEAR(p->view.obj);
22709  return 0;
22710 }
22711 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22712  PyObject *r;
22713  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22714  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22715  Py_DECREF(x);
22716  return r;
22717 }
22718 
22719 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22720  if (v) {
22721  return __pyx_memoryview___setitem__(o, i, v);
22722  }
22723  else {
22724  PyErr_Format(PyExc_NotImplementedError,
22725  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22726  return -1;
22727  }
22728 }
22729 
22730 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22731  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22732 }
22733 
22734 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22735  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22736 }
22737 
22738 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22739  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22740 }
22741 
22742 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22743  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22744 }
22745 
22746 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22747  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22748 }
22749 
22750 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22751  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22752 }
22753 
22754 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22755  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22756 }
22757 
22758 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22759  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22760 }
22761 
22762 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22763  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22764 }
22765 
22766 static PyMethodDef __pyx_methods_memoryview[] = {
22767  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22768  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22769  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22770  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22771  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22772  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22773  {0, 0, 0, 0}
22774 };
22775 
22776 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22777  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22778  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22779  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22780  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22781  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22782  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22783  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22784  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22785  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22786  {0, 0, 0, 0, 0}
22787 };
22788 
22789 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22790  __pyx_memoryview___len__, /*sq_length*/
22791  0, /*sq_concat*/
22792  0, /*sq_repeat*/
22793  __pyx_sq_item_memoryview, /*sq_item*/
22794  0, /*sq_slice*/
22795  0, /*sq_ass_item*/
22796  0, /*sq_ass_slice*/
22797  0, /*sq_contains*/
22798  0, /*sq_inplace_concat*/
22799  0, /*sq_inplace_repeat*/
22800 };
22801 
22802 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22803  __pyx_memoryview___len__, /*mp_length*/
22804  __pyx_memoryview___getitem__, /*mp_subscript*/
22805  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22806 };
22807 
22808 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22809  #if PY_MAJOR_VERSION < 3
22810  0, /*bf_getreadbuffer*/
22811  #endif
22812  #if PY_MAJOR_VERSION < 3
22813  0, /*bf_getwritebuffer*/
22814  #endif
22815  #if PY_MAJOR_VERSION < 3
22816  0, /*bf_getsegcount*/
22817  #endif
22818  #if PY_MAJOR_VERSION < 3
22819  0, /*bf_getcharbuffer*/
22820  #endif
22821  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22822  0, /*bf_releasebuffer*/
22823 };
22824 
22825 static PyTypeObject __pyx_type___pyx_memoryview = {
22826  PyVarObject_HEAD_INIT(0, 0)
22827  "BoundaryConditions.memoryview", /*tp_name*/
22828  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22829  0, /*tp_itemsize*/
22830  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22831  #if PY_VERSION_HEX < 0x030800b4
22832  0, /*tp_print*/
22833  #endif
22834  #if PY_VERSION_HEX >= 0x030800b4
22835  0, /*tp_vectorcall_offset*/
22836  #endif
22837  0, /*tp_getattr*/
22838  0, /*tp_setattr*/
22839  #if PY_MAJOR_VERSION < 3
22840  0, /*tp_compare*/
22841  #endif
22842  #if PY_MAJOR_VERSION >= 3
22843  0, /*tp_as_async*/
22844  #endif
22845  __pyx_memoryview___repr__, /*tp_repr*/
22846  0, /*tp_as_number*/
22847  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22848  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22849  0, /*tp_hash*/
22850  0, /*tp_call*/
22851  __pyx_memoryview___str__, /*tp_str*/
22852  0, /*tp_getattro*/
22853  0, /*tp_setattro*/
22854  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22855  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22856  0, /*tp_doc*/
22857  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22858  __pyx_tp_clear_memoryview, /*tp_clear*/
22859  0, /*tp_richcompare*/
22860  0, /*tp_weaklistoffset*/
22861  0, /*tp_iter*/
22862  0, /*tp_iternext*/
22863  __pyx_methods_memoryview, /*tp_methods*/
22864  0, /*tp_members*/
22865  __pyx_getsets_memoryview, /*tp_getset*/
22866  0, /*tp_base*/
22867  0, /*tp_dict*/
22868  0, /*tp_descr_get*/
22869  0, /*tp_descr_set*/
22870  0, /*tp_dictoffset*/
22871  0, /*tp_init*/
22872  0, /*tp_alloc*/
22873  __pyx_tp_new_memoryview, /*tp_new*/
22874  0, /*tp_free*/
22875  0, /*tp_is_gc*/
22876  0, /*tp_bases*/
22877  0, /*tp_mro*/
22878  0, /*tp_cache*/
22879  0, /*tp_subclasses*/
22880  0, /*tp_weaklist*/
22881  0, /*tp_del*/
22882  0, /*tp_version_tag*/
22883  #if PY_VERSION_HEX >= 0x030400a1
22884  0, /*tp_finalize*/
22885  #endif
22886  #if PY_VERSION_HEX >= 0x030800b1
22887  0, /*tp_vectorcall*/
22888  #endif
22889  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22890  0, /*tp_print*/
22891  #endif
22892 };
22893 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22894 
22895 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22896  struct __pyx_memoryviewslice_obj *p;
22897  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22898  if (unlikely(!o)) return 0;
22899  p = ((struct __pyx_memoryviewslice_obj *)o);
22900  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22901  p->from_object = Py_None; Py_INCREF(Py_None);
22902  p->from_slice.memview = NULL;
22903  return o;
22904 }
22905 
22906 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22907  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22908  #if CYTHON_USE_TP_FINALIZE
22909  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22910  if (PyObject_CallFinalizerFromDealloc(o)) return;
22911  }
22912  #endif
22913  PyObject_GC_UnTrack(o);
22914  {
22915  PyObject *etype, *eval, *etb;
22916  PyErr_Fetch(&etype, &eval, &etb);
22917  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22918  __pyx_memoryviewslice___dealloc__(o);
22919  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22920  PyErr_Restore(etype, eval, etb);
22921  }
22922  Py_CLEAR(p->from_object);
22923  PyObject_GC_Track(o);
22924  __pyx_tp_dealloc_memoryview(o);
22925 }
22926 
22927 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22928  int e;
22929  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22930  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22931  if (p->from_object) {
22932  e = (*v)(p->from_object, a); if (e) return e;
22933  }
22934  return 0;
22935 }
22936 
22937 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22938  PyObject* tmp;
22939  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22940  __pyx_tp_clear_memoryview(o);
22941  tmp = ((PyObject*)p->from_object);
22942  p->from_object = Py_None; Py_INCREF(Py_None);
22943  Py_XDECREF(tmp);
22944  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22945  return 0;
22946 }
22947 
22948 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22949  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22950 }
22951 
22952 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22953  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22954  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22955  {0, 0, 0, 0}
22956 };
22957 
22958 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22959  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22960  {0, 0, 0, 0, 0}
22961 };
22962 
22963 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22964  PyVarObject_HEAD_INIT(0, 0)
22965  "BoundaryConditions._memoryviewslice", /*tp_name*/
22966  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22967  0, /*tp_itemsize*/
22968  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22969  #if PY_VERSION_HEX < 0x030800b4
22970  0, /*tp_print*/
22971  #endif
22972  #if PY_VERSION_HEX >= 0x030800b4
22973  0, /*tp_vectorcall_offset*/
22974  #endif
22975  0, /*tp_getattr*/
22976  0, /*tp_setattr*/
22977  #if PY_MAJOR_VERSION < 3
22978  0, /*tp_compare*/
22979  #endif
22980  #if PY_MAJOR_VERSION >= 3
22981  0, /*tp_as_async*/
22982  #endif
22983  #if CYTHON_COMPILING_IN_PYPY
22984  __pyx_memoryview___repr__, /*tp_repr*/
22985  #else
22986  0, /*tp_repr*/
22987  #endif
22988  0, /*tp_as_number*/
22989  0, /*tp_as_sequence*/
22990  0, /*tp_as_mapping*/
22991  0, /*tp_hash*/
22992  0, /*tp_call*/
22993  #if CYTHON_COMPILING_IN_PYPY
22994  __pyx_memoryview___str__, /*tp_str*/
22995  #else
22996  0, /*tp_str*/
22997  #endif
22998  0, /*tp_getattro*/
22999  0, /*tp_setattro*/
23000  0, /*tp_as_buffer*/
23001  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23002  "Internal class for passing memoryview slices to Python", /*tp_doc*/
23003  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
23004  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
23005  0, /*tp_richcompare*/
23006  0, /*tp_weaklistoffset*/
23007  0, /*tp_iter*/
23008  0, /*tp_iternext*/
23009  __pyx_methods__memoryviewslice, /*tp_methods*/
23010  0, /*tp_members*/
23011  __pyx_getsets__memoryviewslice, /*tp_getset*/
23012  0, /*tp_base*/
23013  0, /*tp_dict*/
23014  0, /*tp_descr_get*/
23015  0, /*tp_descr_set*/
23016  0, /*tp_dictoffset*/
23017  0, /*tp_init*/
23018  0, /*tp_alloc*/
23019  __pyx_tp_new__memoryviewslice, /*tp_new*/
23020  0, /*tp_free*/
23021  0, /*tp_is_gc*/
23022  0, /*tp_bases*/
23023  0, /*tp_mro*/
23024  0, /*tp_cache*/
23025  0, /*tp_subclasses*/
23026  0, /*tp_weaklist*/
23027  0, /*tp_del*/
23028  0, /*tp_version_tag*/
23029  #if PY_VERSION_HEX >= 0x030400a1
23030  0, /*tp_finalize*/
23031  #endif
23032  #if PY_VERSION_HEX >= 0x030800b1
23033  0, /*tp_vectorcall*/
23034  #endif
23035  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23036  0, /*tp_print*/
23037  #endif
23038 };
23039 
23040 static PyMethodDef __pyx_methods[] = {
23041  {0, 0, 0, 0}
23042 };
23043 
23044 #if PY_MAJOR_VERSION >= 3
23045 #if CYTHON_PEP489_MULTI_PHASE_INIT
23046 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
23047 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
23048 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23049  {Py_mod_create, (void*)__pyx_pymod_create},
23050  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
23051  {0, NULL}
23052 };
23053 #endif
23054 
23055 static struct PyModuleDef __pyx_moduledef = {
23056  PyModuleDef_HEAD_INIT,
23057  "BoundaryConditions",
23058  0, /* m_doc */
23059  #if CYTHON_PEP489_MULTI_PHASE_INIT
23060  0, /* m_size */
23061  #else
23062  -1, /* m_size */
23063  #endif
23064  __pyx_methods /* m_methods */,
23065  #if CYTHON_PEP489_MULTI_PHASE_INIT
23066  __pyx_moduledef_slots, /* m_slots */
23067  #else
23068  NULL, /* m_reload */
23069  #endif
23070  NULL, /* m_traverse */
23071  NULL, /* m_clear */
23072  NULL /* m_free */
23073 };
23074 #endif
23075 #ifndef CYTHON_SMALL_CODE
23076 #if defined(__clang__)
23077  #define CYTHON_SMALL_CODE
23078 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
23079  #define CYTHON_SMALL_CODE __attribute__((cold))
23080 #else
23081  #define CYTHON_SMALL_CODE
23082 #endif
23083 #endif
23084 
23085 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23086  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23087  {&__pyx_n_s_BC_Base, __pyx_k_BC_Base, sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
23088  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
23089  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
23090  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
23091  {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition, sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
23092  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
23093  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
23094  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
23095  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
23096  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
23097  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
23098  {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp, sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
23099  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
23100  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23101  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23102  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23103  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23104  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23105  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
23106  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
23107  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23108  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23109  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23110  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23111  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23112  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
23113  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23114  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23115  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23116  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23117  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23118  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23119  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23120  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23121  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23122  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
23123  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
23124  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23125  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23126  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23127  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
23128  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23129  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23130  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23131  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23132  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
23133  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
23134  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
23135  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23136  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
23137  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
23138  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
23139  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
23140  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
23141  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
23142  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23143  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
23144  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23145  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23146  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
23147  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
23148  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23149  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
23150  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23151  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
23152  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
23153  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
23154  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23155  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23156  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
23157  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
23158  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23159  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23160  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
23161  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
23162  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
23163  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23164  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23165  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
23166  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
23167  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
23168  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
23169  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
23170  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23171  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
23172  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23173  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
23174  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23175  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
23176  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23177  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23178  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23179  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
23180  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
23181  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23182  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
23183  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
23184  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23185  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23186  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23187  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23188  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23189  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23190  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
23191  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23192  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23193  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
23194  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23195  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23196  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23197  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
23198  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
23199  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
23200  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
23201  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
23202  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
23203  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
23204  {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp, sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
23205  {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda, sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
23206  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23207  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23208  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
23209  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
23210  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
23211  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
23212  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
23213  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
23214  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23215  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23216  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23217  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23218  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
23219  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
23220  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
23221  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
23222  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
23223  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23224  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23225  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23226  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23227  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
23228  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
23229  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
23230  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
23231  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23232  {0, 0, 0, 0, 0, 0, 0}
23233 };
23234 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
23235  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
23236  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23237  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 777, __pyx_L1_error)
23238  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 781, __pyx_L1_error)
23239  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 959, __pyx_L1_error)
23240  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23241  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23242  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
23243  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
23244  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
23245  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
23246  return 0;
23247  __pyx_L1_error:;
23248  return -1;
23249 }
23250 
23251 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23252  __Pyx_RefNannyDeclarations
23253  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
23254 
23255  /* "BoundaryConditions.py":113
23256  * """
23257  *
23258  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
23259  *
23260  * def setLinearRamp(self,t1,value):
23261  */
23262  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
23263  __Pyx_GOTREF(__pyx_slice__7);
23264  __Pyx_GIVEREF(__pyx_slice__7);
23265 
23266  /* "(tree fragment)":2
23267  * def __reduce_cython__(self):
23268  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
23269  * def __setstate_cython__(self, __pyx_state):
23270  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23271  */
23272  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
23273  __Pyx_GOTREF(__pyx_tuple__11);
23274  __Pyx_GIVEREF(__pyx_tuple__11);
23275 
23276  /* "(tree fragment)":4
23277  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23278  * def __setstate_cython__(self, __pyx_state):
23279  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
23280  */
23281  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
23282  __Pyx_GOTREF(__pyx_tuple__13);
23283  __Pyx_GIVEREF(__pyx_tuple__13);
23284 
23285  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
23286  *
23287  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23288  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23289  *
23290  * if ((child.byteorder == c'>' and little_endian) or
23291  */
23292  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 777, __pyx_L1_error)
23293  __Pyx_GOTREF(__pyx_tuple__15);
23294  __Pyx_GIVEREF(__pyx_tuple__15);
23295 
23296  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
23297  * if ((child.byteorder == c'>' and little_endian) or
23298  * (child.byteorder == c'<' and not little_endian)):
23299  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23300  * # One could encode it in the format string and have Cython
23301  * # complain instead, BUT: < and > in format strings also imply
23302  */
23303  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 781, __pyx_L1_error)
23304  __Pyx_GOTREF(__pyx_tuple__16);
23305  __Pyx_GIVEREF(__pyx_tuple__16);
23306 
23307  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
23308  * t = child.type_num
23309  * if end - f < 5:
23310  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23311  *
23312  * # Until ticket #99 is fixed, use integers to avoid warnings
23313  */
23314  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 801, __pyx_L1_error)
23315  __Pyx_GOTREF(__pyx_tuple__17);
23316  __Pyx_GIVEREF(__pyx_tuple__17);
23317 
23318  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
23319  * __pyx_import_array()
23320  * except Exception:
23321  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23322  *
23323  * cdef inline int import_umath() except -1:
23324  */
23325  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 959, __pyx_L1_error)
23326  __Pyx_GOTREF(__pyx_tuple__18);
23327  __Pyx_GIVEREF(__pyx_tuple__18);
23328 
23329  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
23330  * _import_umath()
23331  * except Exception:
23332  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23333  *
23334  * cdef inline int import_ufunc() except -1:
23335  */
23336  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 965, __pyx_L1_error)
23337  __Pyx_GOTREF(__pyx_tuple__19);
23338  __Pyx_GIVEREF(__pyx_tuple__19);
23339 
23340  /* "View.MemoryView":133
23341  *
23342  * if not self.ndim:
23343  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23344  *
23345  * if itemsize <= 0:
23346  */
23347  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 133, __pyx_L1_error)
23348  __Pyx_GOTREF(__pyx_tuple__20);
23349  __Pyx_GIVEREF(__pyx_tuple__20);
23350 
23351  /* "View.MemoryView":136
23352  *
23353  * if itemsize <= 0:
23354  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23355  *
23356  * if not isinstance(format, bytes):
23357  */
23358  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 136, __pyx_L1_error)
23359  __Pyx_GOTREF(__pyx_tuple__21);
23360  __Pyx_GIVEREF(__pyx_tuple__21);
23361 
23362  /* "View.MemoryView":148
23363  *
23364  * if not self._shape:
23365  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23366  *
23367  *
23368  */
23369  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 148, __pyx_L1_error)
23370  __Pyx_GOTREF(__pyx_tuple__22);
23371  __Pyx_GIVEREF(__pyx_tuple__22);
23372 
23373  /* "View.MemoryView":176
23374  * self.data = <char *>malloc(self.len)
23375  * if not self.data:
23376  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23377  *
23378  * if self.dtype_is_object:
23379  */
23380  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 176, __pyx_L1_error)
23381  __Pyx_GOTREF(__pyx_tuple__23);
23382  __Pyx_GIVEREF(__pyx_tuple__23);
23383 
23384  /* "View.MemoryView":192
23385  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23386  * if not (flags & bufmode):
23387  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23388  * info.buf = self.data
23389  * info.len = self.len
23390  */
23391  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 192, __pyx_L1_error)
23392  __Pyx_GOTREF(__pyx_tuple__24);
23393  __Pyx_GIVEREF(__pyx_tuple__24);
23394 
23395  /* "(tree fragment)":2
23396  * def __reduce_cython__(self):
23397  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23398  * def __setstate_cython__(self, __pyx_state):
23399  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23400  */
23401  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
23402  __Pyx_GOTREF(__pyx_tuple__25);
23403  __Pyx_GIVEREF(__pyx_tuple__25);
23404 
23405  /* "(tree fragment)":4
23406  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23407  * def __setstate_cython__(self, __pyx_state):
23408  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23409  */
23410  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
23411  __Pyx_GOTREF(__pyx_tuple__26);
23412  __Pyx_GIVEREF(__pyx_tuple__26);
23413 
23414  /* "View.MemoryView":418
23415  * def __setitem__(memoryview self, object index, object value):
23416  * if self.view.readonly:
23417  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23418  *
23419  * have_slices, index = _unellipsify(index, self.view.ndim)
23420  */
23421  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 418, __pyx_L1_error)
23422  __Pyx_GOTREF(__pyx_tuple__27);
23423  __Pyx_GIVEREF(__pyx_tuple__27);
23424 
23425  /* "View.MemoryView":495
23426  * result = struct.unpack(self.view.format, bytesitem)
23427  * except struct.error:
23428  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23429  * else:
23430  * if len(self.view.format) == 1:
23431  */
23432  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 495, __pyx_L1_error)
23433  __Pyx_GOTREF(__pyx_tuple__28);
23434  __Pyx_GIVEREF(__pyx_tuple__28);
23435 
23436  /* "View.MemoryView":520
23437  * def __getbuffer__(self, Py_buffer *info, int flags):
23438  * if flags & PyBUF_WRITABLE and self.view.readonly:
23439  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23440  *
23441  * if flags & PyBUF_ND:
23442  */
23443  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 520, __pyx_L1_error)
23444  __Pyx_GOTREF(__pyx_tuple__29);
23445  __Pyx_GIVEREF(__pyx_tuple__29);
23446 
23447  /* "View.MemoryView":570
23448  * if self.view.strides == NULL:
23449  *
23450  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23451  *
23452  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23453  */
23454  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 570, __pyx_L1_error)
23455  __Pyx_GOTREF(__pyx_tuple__30);
23456  __Pyx_GIVEREF(__pyx_tuple__30);
23457 
23458  /* "View.MemoryView":577
23459  * def suboffsets(self):
23460  * if self.view.suboffsets == NULL:
23461  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23462  *
23463  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23464  */
23465  __pyx_tuple__31 = PyTuple_New(1); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 577, __pyx_L1_error)
23466  __Pyx_GOTREF(__pyx_tuple__31);
23467  __Pyx_INCREF(__pyx_int_neg_1);
23468  __Pyx_GIVEREF(__pyx_int_neg_1);
23469  PyTuple_SET_ITEM(__pyx_tuple__31, 0, __pyx_int_neg_1);
23470  __Pyx_GIVEREF(__pyx_tuple__31);
23471 
23472  /* "(tree fragment)":2
23473  * def __reduce_cython__(self):
23474  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23475  * def __setstate_cython__(self, __pyx_state):
23476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23477  */
23478  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error)
23479  __Pyx_GOTREF(__pyx_tuple__32);
23480  __Pyx_GIVEREF(__pyx_tuple__32);
23481 
23482  /* "(tree fragment)":4
23483  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23484  * def __setstate_cython__(self, __pyx_state):
23485  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23486  */
23487  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error)
23488  __Pyx_GOTREF(__pyx_tuple__33);
23489  __Pyx_GIVEREF(__pyx_tuple__33);
23490 
23491  /* "View.MemoryView":703
23492  * for suboffset in suboffsets[:ndim]:
23493  * if suboffset >= 0:
23494  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23495  *
23496  *
23497  */
23498  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 703, __pyx_L1_error)
23499  __Pyx_GOTREF(__pyx_tuple__34);
23500  __Pyx_GIVEREF(__pyx_tuple__34);
23501 
23502  /* "(tree fragment)":2
23503  * def __reduce_cython__(self):
23504  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23505  * def __setstate_cython__(self, __pyx_state):
23506  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23507  */
23508  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 2, __pyx_L1_error)
23509  __Pyx_GOTREF(__pyx_tuple__35);
23510  __Pyx_GIVEREF(__pyx_tuple__35);
23511 
23512  /* "(tree fragment)":4
23513  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23514  * def __setstate_cython__(self, __pyx_state):
23515  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23516  */
23517  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
23518  __Pyx_GOTREF(__pyx_tuple__36);
23519  __Pyx_GIVEREF(__pyx_tuple__36);
23520 
23521  /* "BoundaryConditions.py":52
23522  * # setattr(BC_Base, name, default_value)
23523  *
23524  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23525  * """
23526  * Gets context from proteus.Context or
23527  */
23528  __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 52, __pyx_L1_error)
23529  __Pyx_GOTREF(__pyx_tuple__38);
23530  __Pyx_GIVEREF(__pyx_tuple__38);
23531  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23532 
23533  /* "(tree fragment)":1
23534  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23535  * cdef tuple state
23536  * cdef object _dict
23537  */
23538  __pyx_tuple__39 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1, __pyx_L1_error)
23539  __Pyx_GOTREF(__pyx_tuple__39);
23540  __Pyx_GIVEREF(__pyx_tuple__39);
23541  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23542 
23543  /* "(tree fragment)":16
23544  * else:
23545  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23546  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23547  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23548  */
23549  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 16, __pyx_L1_error)
23550  __Pyx_GOTREF(__pyx_tuple__40);
23551  __Pyx_GIVEREF(__pyx_tuple__40);
23552  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23553 
23554  /* "BoundaryConditions.py":81
23555  * self.uOfXT = None
23556  *
23557  * def init_cython(self): # <<<<<<<<<<<<<<
23558  * return self.uOfXT
23559  *
23560  */
23561  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 81, __pyx_L1_error)
23562  __Pyx_GOTREF(__pyx_tuple__41);
23563  __Pyx_GIVEREF(__pyx_tuple__41);
23564  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23565 
23566  /* "BoundaryConditions.py":84
23567  * return self.uOfXT
23568  *
23569  * def resetBC(self): # <<<<<<<<<<<<<<
23570  * self.uOfXT = None
23571  *
23572  */
23573  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 84, __pyx_L1_error)
23574  __Pyx_GOTREF(__pyx_tuple__42);
23575  __Pyx_GIVEREF(__pyx_tuple__42);
23576  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23577 
23578  /* "BoundaryConditions.py":87
23579  * self.uOfXT = None
23580  *
23581  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23582  * """
23583  * function returning constant BC
23584  */
23585  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 87, __pyx_L1_error)
23586  __Pyx_GOTREF(__pyx_tuple__43);
23587  __Pyx_GIVEREF(__pyx_tuple__43);
23588  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23589 
23590  /* "BoundaryConditions.py":100
23591  *
23592  *
23593  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23594  * """
23595  * function returning value=a0+ax*x+ay*y+az*z
23596  */
23597  __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 100, __pyx_L1_error)
23598  __Pyx_GOTREF(__pyx_tuple__44);
23599  __Pyx_GIVEREF(__pyx_tuple__44);
23600  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23601 
23602  /* "BoundaryConditions.py":115
23603  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23604  *
23605  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23606  * """
23607  * function setting a linear ramp from t=0 to t=t1
23608  */
23609  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 115, __pyx_L1_error)
23610  __Pyx_GOTREF(__pyx_tuple__45);
23611  __Pyx_GIVEREF(__pyx_tuple__45);
23612  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23613 
23614  /* "(tree fragment)":1
23615  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23616  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23617  * def __setstate_cython__(self, __pyx_state):
23618  */
23619  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
23620  __Pyx_GOTREF(__pyx_tuple__46);
23621  __Pyx_GIVEREF(__pyx_tuple__46);
23622  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23623 
23624  /* "(tree fragment)":3
23625  * def __reduce_cython__(self):
23626  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23627  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23628  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23629  */
23630  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 3, __pyx_L1_error)
23631  __Pyx_GOTREF(__pyx_tuple__47);
23632  __Pyx_GIVEREF(__pyx_tuple__47);
23633  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23634 
23635  /* "(tree fragment)":1
23636  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23637  * cdef object __pyx_PickleError
23638  * cdef object __pyx_result
23639  */
23640  __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
23641  __Pyx_GOTREF(__pyx_tuple__48);
23642  __Pyx_GIVEREF(__pyx_tuple__48);
23643  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23644 
23645  /* "View.MemoryView":286
23646  * return self.name
23647  *
23648  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23649  * cdef strided = Enum("<strided and direct>") # default
23650  * cdef indirect = Enum("<strided and indirect>")
23651  */
23652  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 286, __pyx_L1_error)
23653  __Pyx_GOTREF(__pyx_tuple__49);
23654  __Pyx_GIVEREF(__pyx_tuple__49);
23655 
23656  /* "View.MemoryView":287
23657  *
23658  * cdef generic = Enum("<strided and direct or indirect>")
23659  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23660  * cdef indirect = Enum("<strided and indirect>")
23661  *
23662  */
23663  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 287, __pyx_L1_error)
23664  __Pyx_GOTREF(__pyx_tuple__50);
23665  __Pyx_GIVEREF(__pyx_tuple__50);
23666 
23667  /* "View.MemoryView":288
23668  * cdef generic = Enum("<strided and direct or indirect>")
23669  * cdef strided = Enum("<strided and direct>") # default
23670  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23671  *
23672  *
23673  */
23674  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 288, __pyx_L1_error)
23675  __Pyx_GOTREF(__pyx_tuple__51);
23676  __Pyx_GIVEREF(__pyx_tuple__51);
23677 
23678  /* "View.MemoryView":291
23679  *
23680  *
23681  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23682  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23683  *
23684  */
23685  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 291, __pyx_L1_error)
23686  __Pyx_GOTREF(__pyx_tuple__52);
23687  __Pyx_GIVEREF(__pyx_tuple__52);
23688 
23689  /* "View.MemoryView":292
23690  *
23691  * cdef contiguous = Enum("<contiguous and direct>")
23692  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23693  *
23694  *
23695  */
23696  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 292, __pyx_L1_error)
23697  __Pyx_GOTREF(__pyx_tuple__53);
23698  __Pyx_GIVEREF(__pyx_tuple__53);
23699 
23700  /* "(tree fragment)":1
23701  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23702  * cdef object __pyx_PickleError
23703  * cdef object __pyx_result
23704  */
23705  __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
23706  __Pyx_GOTREF(__pyx_tuple__54);
23707  __Pyx_GIVEREF(__pyx_tuple__54);
23708  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error)
23709  __Pyx_RefNannyFinishContext();
23710  return 0;
23711  __pyx_L1_error:;
23712  __Pyx_RefNannyFinishContext();
23713  return -1;
23714 }
23715 
23716 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23717  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23718  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23719  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23720  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23721  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23722  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23723  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23724  return 0;
23725  __pyx_L1_error:;
23726  return -1;
23727 }
23728 
23729 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23730 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23731 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23732 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23733 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23734 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23735 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23736 
23737 static int __Pyx_modinit_global_init_code(void) {
23738  __Pyx_RefNannyDeclarations
23739  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23740  /*--- Global init code ---*/
23741  generic = Py_None; Py_INCREF(Py_None);
23742  strided = Py_None; Py_INCREF(Py_None);
23743  indirect = Py_None; Py_INCREF(Py_None);
23744  contiguous = Py_None; Py_INCREF(Py_None);
23745  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23746  __Pyx_RefNannyFinishContext();
23747  return 0;
23748 }
23749 
23750 static int __Pyx_modinit_variable_export_code(void) {
23751  __Pyx_RefNannyDeclarations
23752  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23753  /*--- Variable export code ---*/
23754  __Pyx_RefNannyFinishContext();
23755  return 0;
23756 }
23757 
23758 static int __Pyx_modinit_function_export_code(void) {
23759  __Pyx_RefNannyDeclarations
23760  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23761  /*--- Function export code ---*/
23762  __Pyx_RefNannyFinishContext();
23763  return 0;
23764 }
23765 
23766 static int __Pyx_modinit_type_init_code(void) {
23767  __Pyx_RefNannyDeclarations
23768  int __pyx_lineno = 0;
23769  const char *__pyx_filename = NULL;
23770  int __pyx_clineno = 0;
23771  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23772  /*--- Type init code ---*/
23773  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23774  #if PY_VERSION_HEX < 0x030800B1
23775  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23776  #endif
23777  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23778  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23779  }
23780  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23781  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23782  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23783  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23784  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23785  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23786  #if PY_VERSION_HEX < 0x030800B1
23787  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23788  #endif
23789  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23790  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23791  }
23792  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23793  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23794  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23795  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23796  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23797  #if PY_VERSION_HEX < 0x030800B1
23798  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23799  #endif
23800  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23801  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23802  }
23803  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23804  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23805  #if PY_VERSION_HEX < 0x030800B1
23806  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23807  #endif
23808  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23809  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23810  }
23811  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23812  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23813  #if PY_VERSION_HEX < 0x030800B1
23814  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23815  #endif
23816  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23817  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23818  }
23819  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23820  __pyx_vtabptr_array = &__pyx_vtable_array;
23821  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23822  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23823  #if PY_VERSION_HEX < 0x030800B1
23824  __pyx_type___pyx_array.tp_print = 0;
23825  #endif
23826  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23827  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23828  __pyx_array_type = &__pyx_type___pyx_array;
23829  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23830  #if PY_VERSION_HEX < 0x030800B1
23831  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23832  #endif
23833  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23834  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23835  }
23836  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23837  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23838  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23839  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23840  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23841  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23842  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23843  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23844  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23845  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23846  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23847  #if PY_VERSION_HEX < 0x030800B1
23848  __pyx_type___pyx_memoryview.tp_print = 0;
23849  #endif
23850  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23851  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23852  }
23853  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23854  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23855  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23856  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23857  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23858  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23859  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23860  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23861  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23862  #if PY_VERSION_HEX < 0x030800B1
23863  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23864  #endif
23865  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23866  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23867  }
23868  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23869  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23870  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23871  __Pyx_RefNannyFinishContext();
23872  return 0;
23873  __pyx_L1_error:;
23874  __Pyx_RefNannyFinishContext();
23875  return -1;
23876 }
23877 
23878 static int __Pyx_modinit_type_import_code(void) {
23879  __Pyx_RefNannyDeclarations
23880  PyObject *__pyx_t_1 = NULL;
23881  int __pyx_lineno = 0;
23882  const char *__pyx_filename = NULL;
23883  int __pyx_clineno = 0;
23884  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23885  /*--- Type import code ---*/
23886  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23887  __Pyx_GOTREF(__pyx_t_1);
23888  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23889  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23890  sizeof(PyTypeObject),
23891  #else
23892  sizeof(PyHeapTypeObject),
23893  #endif
23894  __Pyx_ImportType_CheckSize_Warn);
23895  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23896  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23897  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 207, __pyx_L1_error)
23898  __Pyx_GOTREF(__pyx_t_1);
23899  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23900  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 207, __pyx_L1_error)
23901  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23902  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 230, __pyx_L1_error)
23903  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23904  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 234, __pyx_L1_error)
23905  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23906  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 246, __pyx_L1_error)
23907  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23908  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 839, __pyx_L1_error)
23909  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23910  __Pyx_RefNannyFinishContext();
23911  return 0;
23912  __pyx_L1_error:;
23913  __Pyx_XDECREF(__pyx_t_1);
23914  __Pyx_RefNannyFinishContext();
23915  return -1;
23916 }
23917 
23918 static int __Pyx_modinit_variable_import_code(void) {
23919  __Pyx_RefNannyDeclarations
23920  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23921  /*--- Variable import code ---*/
23922  __Pyx_RefNannyFinishContext();
23923  return 0;
23924 }
23925 
23926 static int __Pyx_modinit_function_import_code(void) {
23927  __Pyx_RefNannyDeclarations
23928  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23929  /*--- Function import code ---*/
23930  __Pyx_RefNannyFinishContext();
23931  return 0;
23932 }
23933 
23934 
23935 #ifndef CYTHON_NO_PYINIT_EXPORT
23936 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23937 #elif PY_MAJOR_VERSION < 3
23938 #ifdef __cplusplus
23939 #define __Pyx_PyMODINIT_FUNC extern "C" void
23940 #else
23941 #define __Pyx_PyMODINIT_FUNC void
23942 #endif
23943 #else
23944 #ifdef __cplusplus
23945 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23946 #else
23947 #define __Pyx_PyMODINIT_FUNC PyObject *
23948 #endif
23949 #endif
23950 
23951 
23952 #if PY_MAJOR_VERSION < 3
23953 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23954 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
23955 #else
23956 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23957 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
23958 #if CYTHON_PEP489_MULTI_PHASE_INIT
23959 {
23960  return PyModuleDef_Init(&__pyx_moduledef);
23961 }
23962 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23963  #if PY_VERSION_HEX >= 0x030700A1
23964  static PY_INT64_T main_interpreter_id = -1;
23965  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23966  if (main_interpreter_id == -1) {
23967  main_interpreter_id = current_id;
23968  return (unlikely(current_id == -1)) ? -1 : 0;
23969  } else if (unlikely(main_interpreter_id != current_id))
23970  #else
23971  static PyInterpreterState *main_interpreter = NULL;
23972  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23973  if (!main_interpreter) {
23974  main_interpreter = current_interpreter;
23975  } else if (unlikely(main_interpreter != current_interpreter))
23976  #endif
23977  {
23978  PyErr_SetString(
23979  PyExc_ImportError,
23980  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23981  return -1;
23982  }
23983  return 0;
23984 }
23985 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23986  PyObject *value = PyObject_GetAttrString(spec, from_name);
23987  int result = 0;
23988  if (likely(value)) {
23989  if (allow_none || value != Py_None) {
23990  result = PyDict_SetItemString(moddict, to_name, value);
23991  }
23992  Py_DECREF(value);
23993  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23994  PyErr_Clear();
23995  } else {
23996  result = -1;
23997  }
23998  return result;
23999 }
24000 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24001  PyObject *module = NULL, *moddict, *modname;
24002  if (__Pyx_check_single_interpreter())
24003  return NULL;
24004  if (__pyx_m)
24005  return __Pyx_NewRef(__pyx_m);
24006  modname = PyObject_GetAttrString(spec, "name");
24007  if (unlikely(!modname)) goto bad;
24008  module = PyModule_NewObject(modname);
24009  Py_DECREF(modname);
24010  if (unlikely(!module)) goto bad;
24011  moddict = PyModule_GetDict(module);
24012  if (unlikely(!moddict)) goto bad;
24013  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
24014  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
24015  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
24016  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
24017  return module;
24018 bad:
24019  Py_XDECREF(module);
24020  return NULL;
24021 }
24022 
24023 
24024 static CYTHON_SMALL_CODE int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
24025 #endif
24026 #endif
24027 {
24028  __Pyx_TraceDeclarations
24029  PyObject *__pyx_t_1 = NULL;
24030  static PyThread_type_lock __pyx_t_2[8];
24031  int __pyx_lineno = 0;
24032  const char *__pyx_filename = NULL;
24033  int __pyx_clineno = 0;
24034  __Pyx_RefNannyDeclarations
24035  #if CYTHON_PEP489_MULTI_PHASE_INIT
24036  if (__pyx_m) {
24037  if (__pyx_m == __pyx_pyinit_module) return 0;
24038  PyErr_SetString(PyExc_RuntimeError, "Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
24039  return -1;
24040  }
24041  #elif PY_MAJOR_VERSION >= 3
24042  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
24043  #endif
24044  #if CYTHON_REFNANNY
24045 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24046 if (!__Pyx_RefNanny) {
24047  PyErr_Clear();
24048  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24049  if (!__Pyx_RefNanny)
24050  Py_FatalError("failed to import 'refnanny' module");
24051 }
24052 #endif
24053  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
24054  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24055  #ifdef __Pxy_PyFrame_Initialize_Offsets
24056  __Pxy_PyFrame_Initialize_Offsets();
24057  #endif
24058  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24059  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24060  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24061  #ifdef __Pyx_CyFunction_USED
24062  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24063  #endif
24064  #ifdef __Pyx_FusedFunction_USED
24065  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24066  #endif
24067  #ifdef __Pyx_Coroutine_USED
24068  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24069  #endif
24070  #ifdef __Pyx_Generator_USED
24071  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24072  #endif
24073  #ifdef __Pyx_AsyncGen_USED
24074  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24075  #endif
24076  #ifdef __Pyx_StopAsyncIteration_USED
24077  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24078  #endif
24079  /*--- Library function declarations ---*/
24080  /*--- Threads initialization code ---*/
24081  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24082  #ifdef WITH_THREAD /* Python build with threading support? */
24083  PyEval_InitThreads();
24084  #endif
24085  #endif
24086  /*--- Module creation code ---*/
24087  #if CYTHON_PEP489_MULTI_PHASE_INIT
24088  __pyx_m = __pyx_pyinit_module;
24089  Py_INCREF(__pyx_m);
24090  #else
24091  #if PY_MAJOR_VERSION < 3
24092  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24093  #else
24094  __pyx_m = PyModule_Create(&__pyx_moduledef);
24095  #endif
24096  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24097  #endif
24098  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24099  Py_INCREF(__pyx_d);
24100  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24101  Py_INCREF(__pyx_b);
24102  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24103  Py_INCREF(__pyx_cython_runtime);
24104  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24105  /*--- Initialize various global constants etc. ---*/
24106  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24107  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24108  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24109  #endif
24110  if (__pyx_module_is_main_BoundaryConditions) {
24111  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24112  }
24113  #if PY_MAJOR_VERSION >= 3
24114  {
24115  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24116  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
24117  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24118  }
24119  }
24120  #endif
24121  /*--- Builtin init code ---*/
24122  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24123  /*--- Constants init code ---*/
24124  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24125  /*--- Global type/function init code ---*/
24126  (void)__Pyx_modinit_global_init_code();
24127  (void)__Pyx_modinit_variable_export_code();
24128  (void)__Pyx_modinit_function_export_code();
24129  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24130  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24131  (void)__Pyx_modinit_variable_import_code();
24132  (void)__Pyx_modinit_function_import_code();
24133  /*--- Execution code ---*/
24134  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24135  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24136  #endif
24137  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
24138 
24139  /* "BoundaryConditions.py":9
24140  *
24141  * import cython
24142  * import numpy as np # <<<<<<<<<<<<<<
24143  * """
24144  * Module for creating boundary conditions. Imported in SpatialTools.py
24145  */
24146  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
24147  __Pyx_GOTREF(__pyx_t_1);
24148  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
24149  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24150 
24151  /* "BoundaryConditions.py":17
24152  * """
24153  *
24154  * __all__ = ['BC_Base', # <<<<<<<<<<<<<<
24155  * 'BoundaryCondition']
24156  *
24157  */
24158  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
24159  __Pyx_GOTREF(__pyx_t_1);
24160  __Pyx_INCREF(__pyx_n_s_BC_Base);
24161  __Pyx_GIVEREF(__pyx_n_s_BC_Base);
24162  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
24163  __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
24164  __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
24165  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
24166  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
24167  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24168 
24169  /* "BoundaryConditions.py":52
24170  * # setattr(BC_Base, name, default_value)
24171  *
24172  * def getContext(self, context=None): # <<<<<<<<<<<<<<
24173  * """
24174  * Gets context from proteus.Context or
24175  */
24176  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
24177  __Pyx_GOTREF(__pyx_t_1);
24178  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
24179  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24180  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24181 
24182  /* "(tree fragment)":1
24183  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24184  * cdef tuple state
24185  * cdef object _dict
24186  */
24187  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24188  __Pyx_GOTREF(__pyx_t_1);
24189  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24190  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24191  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24192 
24193  /* "(tree fragment)":16
24194  * else:
24195  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
24196  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24197  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
24198  */
24199  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
24200  __Pyx_GOTREF(__pyx_t_1);
24201  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
24202  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24203  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24204 
24205  /* "BoundaryConditions.py":81
24206  * self.uOfXT = None
24207  *
24208  * def init_cython(self): # <<<<<<<<<<<<<<
24209  * return self.uOfXT
24210  *
24211  */
24212  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
24213  __Pyx_GOTREF(__pyx_t_1);
24214  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
24215  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24216  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24217 
24218  /* "BoundaryConditions.py":84
24219  * return self.uOfXT
24220  *
24221  * def resetBC(self): # <<<<<<<<<<<<<<
24222  * self.uOfXT = None
24223  *
24224  */
24225  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24226  __Pyx_GOTREF(__pyx_t_1);
24227  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24228  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24229  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24230 
24231  /* "BoundaryConditions.py":87
24232  * self.uOfXT = None
24233  *
24234  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
24235  * """
24236  * function returning constant BC
24237  */
24238  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
24239  __Pyx_GOTREF(__pyx_t_1);
24240  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24241  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24242  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24243 
24244  /* "BoundaryConditions.py":100
24245  *
24246  *
24247  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
24248  * """
24249  * function returning value=a0+ax*x+ay*y+az*z
24250  */
24251  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
24252  __Pyx_GOTREF(__pyx_t_1);
24253  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24254  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24255  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24256 
24257  /* "BoundaryConditions.py":115
24258  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
24259  *
24260  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
24261  * """
24262  * function setting a linear ramp from t=0 to t=t1
24263  */
24264  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
24265  __Pyx_GOTREF(__pyx_t_1);
24266  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24267  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24268  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24269 
24270  /* "(tree fragment)":1
24271  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24272  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24273  * def __setstate_cython__(self, __pyx_state):
24274  */
24275  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24276  __Pyx_GOTREF(__pyx_t_1);
24277  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24278  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24279 
24280  /* "(tree fragment)":3
24281  * def __reduce_cython__(self):
24282  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24283  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24284  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24285  */
24286  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
24287  __Pyx_GOTREF(__pyx_t_1);
24288  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
24289  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24290 
24291  /* "(tree fragment)":1
24292  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24293  * cdef object __pyx_PickleError
24294  * cdef object __pyx_result
24295  */
24296  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24297  __Pyx_GOTREF(__pyx_t_1);
24298  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24299  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24300 
24301  /* "BoundaryConditions.py":1
24302  * #!python # <<<<<<<<<<<<<<
24303  * # distutils: language = c++
24304  * # cython: profile=True, binding=True, embedsignature=True
24305  */
24306  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24307  __Pyx_GOTREF(__pyx_t_1);
24308  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24309  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24310 
24311  /* "View.MemoryView":209
24312  * info.obj = self
24313  *
24314  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24315  *
24316  * def __dealloc__(array self):
24317  */
24318  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24319  __Pyx_GOTREF(__pyx_t_1);
24320  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24321  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24322  PyType_Modified(__pyx_array_type);
24323 
24324  /* "View.MemoryView":286
24325  * return self.name
24326  *
24327  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24328  * cdef strided = Enum("<strided and direct>") # default
24329  * cdef indirect = Enum("<strided and indirect>")
24330  */
24331  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24332  __Pyx_GOTREF(__pyx_t_1);
24333  __Pyx_XGOTREF(generic);
24334  __Pyx_DECREF_SET(generic, __pyx_t_1);
24335  __Pyx_GIVEREF(__pyx_t_1);
24336  __pyx_t_1 = 0;
24337 
24338  /* "View.MemoryView":287
24339  *
24340  * cdef generic = Enum("<strided and direct or indirect>")
24341  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24342  * cdef indirect = Enum("<strided and indirect>")
24343  *
24344  */
24345  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24346  __Pyx_GOTREF(__pyx_t_1);
24347  __Pyx_XGOTREF(strided);
24348  __Pyx_DECREF_SET(strided, __pyx_t_1);
24349  __Pyx_GIVEREF(__pyx_t_1);
24350  __pyx_t_1 = 0;
24351 
24352  /* "View.MemoryView":288
24353  * cdef generic = Enum("<strided and direct or indirect>")
24354  * cdef strided = Enum("<strided and direct>") # default
24355  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24356  *
24357  *
24358  */
24359  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24360  __Pyx_GOTREF(__pyx_t_1);
24361  __Pyx_XGOTREF(indirect);
24362  __Pyx_DECREF_SET(indirect, __pyx_t_1);
24363  __Pyx_GIVEREF(__pyx_t_1);
24364  __pyx_t_1 = 0;
24365 
24366  /* "View.MemoryView":291
24367  *
24368  *
24369  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24370  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24371  *
24372  */
24373  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24374  __Pyx_GOTREF(__pyx_t_1);
24375  __Pyx_XGOTREF(contiguous);
24376  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24377  __Pyx_GIVEREF(__pyx_t_1);
24378  __pyx_t_1 = 0;
24379 
24380  /* "View.MemoryView":292
24381  *
24382  * cdef contiguous = Enum("<contiguous and direct>")
24383  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24384  *
24385  *
24386  */
24387  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24388  __Pyx_GOTREF(__pyx_t_1);
24389  __Pyx_XGOTREF(indirect_contiguous);
24390  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24391  __Pyx_GIVEREF(__pyx_t_1);
24392  __pyx_t_1 = 0;
24393 
24394  /* "View.MemoryView":316
24395  *
24396  * DEF THREAD_LOCKS_PREALLOCATED = 8
24397  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24398  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24399  * PyThread_allocate_lock(),
24400  */
24401  __pyx_memoryview_thread_locks_used = 0;
24402 
24403  /* "View.MemoryView":317
24404  * DEF THREAD_LOCKS_PREALLOCATED = 8
24405  * cdef int __pyx_memoryview_thread_locks_used = 0
24406  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24407  * PyThread_allocate_lock(),
24408  * PyThread_allocate_lock(),
24409  */
24410  __pyx_t_2[0] = PyThread_allocate_lock();
24411  __pyx_t_2[1] = PyThread_allocate_lock();
24412  __pyx_t_2[2] = PyThread_allocate_lock();
24413  __pyx_t_2[3] = PyThread_allocate_lock();
24414  __pyx_t_2[4] = PyThread_allocate_lock();
24415  __pyx_t_2[5] = PyThread_allocate_lock();
24416  __pyx_t_2[6] = PyThread_allocate_lock();
24417  __pyx_t_2[7] = PyThread_allocate_lock();
24418  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24419 
24420  /* "View.MemoryView":549
24421  * info.obj = self
24422  *
24423  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24424  *
24425  *
24426  */
24427  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24428  __Pyx_GOTREF(__pyx_t_1);
24429  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24430  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24431  PyType_Modified(__pyx_memoryview_type);
24432 
24433  /* "View.MemoryView":995
24434  * return self.from_object
24435  *
24436  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24437  *
24438  *
24439  */
24440  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24441  __Pyx_GOTREF(__pyx_t_1);
24442  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24443  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24444  PyType_Modified(__pyx_memoryviewslice_type);
24445 
24446  /* "(tree fragment)":1
24447  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24448  * cdef object __pyx_PickleError
24449  * cdef object __pyx_result
24450  */
24451  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24452  __Pyx_GOTREF(__pyx_t_1);
24453  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24455 
24456  /* "(tree fragment)":11
24457  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24458  * return __pyx_result
24459  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24460  * __pyx_result.name = __pyx_state[0]
24461  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24462  */
24463  __Pyx_TraceReturn(Py_None, 0);
24464 
24465  /*--- Wrapped vars code ---*/
24466 
24467  goto __pyx_L0;
24468  __pyx_L1_error:;
24469  __Pyx_XDECREF(__pyx_t_1);
24470  if (__pyx_m) {
24471  if (__pyx_d) {
24472  __Pyx_AddTraceback("init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24473  }
24474  Py_CLEAR(__pyx_m);
24475  } else if (!PyErr_Occurred()) {
24476  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
24477  }
24478  __pyx_L0:;
24479  __Pyx_RefNannyFinishContext();
24480  #if CYTHON_PEP489_MULTI_PHASE_INIT
24481  return (__pyx_m != NULL) ? 0 : -1;
24482  #elif PY_MAJOR_VERSION >= 3
24483  return __pyx_m;
24484  #else
24485  return;
24486  #endif
24487 }
24488 
24489 /* --- Runtime support code --- */
24490 /* Refnanny */
24491 #if CYTHON_REFNANNY
24492 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24493  PyObject *m = NULL, *p = NULL;
24494  void *r = NULL;
24495  m = PyImport_ImportModule(modname);
24496  if (!m) goto end;
24497  p = PyObject_GetAttrString(m, "RefNannyAPI");
24498  if (!p) goto end;
24499  r = PyLong_AsVoidPtr(p);
24500 end:
24501  Py_XDECREF(p);
24502  Py_XDECREF(m);
24503  return (__Pyx_RefNannyAPIStruct *)r;
24504 }
24505 #endif
24506 
24507 /* PyObjectGetAttrStr */
24508 #if CYTHON_USE_TYPE_SLOTS
24509 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24510  PyTypeObject* tp = Py_TYPE(obj);
24511  if (likely(tp->tp_getattro))
24512  return tp->tp_getattro(obj, attr_name);
24513 #if PY_MAJOR_VERSION < 3
24514  if (likely(tp->tp_getattr))
24515  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24516 #endif
24517  return PyObject_GetAttr(obj, attr_name);
24518 }
24519 #endif
24520 
24521 /* GetBuiltinName */
24522 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24523  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24524  if (unlikely(!result)) {
24525  PyErr_Format(PyExc_NameError,
24526 #if PY_MAJOR_VERSION >= 3
24527  "name '%U' is not defined", name);
24528 #else
24529  "name '%.200s' is not defined", PyString_AS_STRING(name));
24530 #endif
24531  }
24532  return result;
24533 }
24534 
24535 /* RaiseDoubleKeywords */
24536 static void __Pyx_RaiseDoubleKeywordsError(
24537  const char* func_name,
24538  PyObject* kw_name)
24539 {
24540  PyErr_Format(PyExc_TypeError,
24541  #if PY_MAJOR_VERSION >= 3
24542  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24543  #else
24544  "%s() got multiple values for keyword argument '%s'", func_name,
24545  PyString_AsString(kw_name));
24546  #endif
24547 }
24548 
24549 /* ParseKeywords */
24550 static int __Pyx_ParseOptionalKeywords(
24551  PyObject *kwds,
24552  PyObject **argnames[],
24553  PyObject *kwds2,
24554  PyObject *values[],
24555  Py_ssize_t num_pos_args,
24556  const char* function_name)
24557 {
24558  PyObject *key = 0, *value = 0;
24559  Py_ssize_t pos = 0;
24560  PyObject*** name;
24561  PyObject*** first_kw_arg = argnames + num_pos_args;
24562  while (PyDict_Next(kwds, &pos, &key, &value)) {
24563  name = first_kw_arg;
24564  while (*name && (**name != key)) name++;
24565  if (*name) {
24566  values[name-argnames] = value;
24567  continue;
24568  }
24569  name = first_kw_arg;
24570  #if PY_MAJOR_VERSION < 3
24571  if (likely(PyString_Check(key))) {
24572  while (*name) {
24573  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24574  && _PyString_Eq(**name, key)) {
24575  values[name-argnames] = value;
24576  break;
24577  }
24578  name++;
24579  }
24580  if (*name) continue;
24581  else {
24582  PyObject*** argname = argnames;
24583  while (argname != first_kw_arg) {
24584  if ((**argname == key) || (
24585  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24586  && _PyString_Eq(**argname, key))) {
24587  goto arg_passed_twice;
24588  }
24589  argname++;
24590  }
24591  }
24592  } else
24593  #endif
24594  if (likely(PyUnicode_Check(key))) {
24595  while (*name) {
24596  int cmp = (**name == key) ? 0 :
24597  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24598  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24599  #endif
24600  PyUnicode_Compare(**name, key);
24601  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24602  if (cmp == 0) {
24603  values[name-argnames] = value;
24604  break;
24605  }
24606  name++;
24607  }
24608  if (*name) continue;
24609  else {
24610  PyObject*** argname = argnames;
24611  while (argname != first_kw_arg) {
24612  int cmp = (**argname == key) ? 0 :
24613  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24614  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24615  #endif
24616  PyUnicode_Compare(**argname, key);
24617  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24618  if (cmp == 0) goto arg_passed_twice;
24619  argname++;
24620  }
24621  }
24622  } else
24623  goto invalid_keyword_type;
24624  if (kwds2) {
24625  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24626  } else {
24627  goto invalid_keyword;
24628  }
24629  }
24630  return 0;
24631 arg_passed_twice:
24632  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24633  goto bad;
24634 invalid_keyword_type:
24635  PyErr_Format(PyExc_TypeError,
24636  "%.200s() keywords must be strings", function_name);
24637  goto bad;
24638 invalid_keyword:
24639  PyErr_Format(PyExc_TypeError,
24640  #if PY_MAJOR_VERSION < 3
24641  "%.200s() got an unexpected keyword argument '%.200s'",
24642  function_name, PyString_AsString(key));
24643  #else
24644  "%s() got an unexpected keyword argument '%U'",
24645  function_name, key);
24646  #endif
24647 bad:
24648  return -1;
24649 }
24650 
24651 /* RaiseArgTupleInvalid */
24652 static void __Pyx_RaiseArgtupleInvalid(
24653  const char* func_name,
24654  int exact,
24655  Py_ssize_t num_min,
24656  Py_ssize_t num_max,
24657  Py_ssize_t num_found)
24658 {
24659  Py_ssize_t num_expected;
24660  const char *more_or_less;
24661  if (num_found < num_min) {
24662  num_expected = num_min;
24663  more_or_less = "at least";
24664  } else {
24665  num_expected = num_max;
24666  more_or_less = "at most";
24667  }
24668  if (exact) {
24669  more_or_less = "exactly";
24670  }
24671  PyErr_Format(PyExc_TypeError,
24672  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24673  func_name, more_or_less, num_expected,
24674  (num_expected == 1) ? "" : "s", num_found);
24675 }
24676 
24677 /* PyErrFetchRestore */
24678 #if CYTHON_FAST_THREAD_STATE
24679 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24680  PyObject *tmp_type, *tmp_value, *tmp_tb;
24681  tmp_type = tstate->curexc_type;
24682  tmp_value = tstate->curexc_value;
24683  tmp_tb = tstate->curexc_traceback;
24684  tstate->curexc_type = type;
24685  tstate->curexc_value = value;
24686  tstate->curexc_traceback = tb;
24687  Py_XDECREF(tmp_type);
24688  Py_XDECREF(tmp_value);
24689  Py_XDECREF(tmp_tb);
24690 }
24691 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24692  *type = tstate->curexc_type;
24693  *value = tstate->curexc_value;
24694  *tb = tstate->curexc_traceback;
24695  tstate->curexc_type = 0;
24696  tstate->curexc_value = 0;
24697  tstate->curexc_traceback = 0;
24698 }
24699 #endif
24700 
24701 /* Profile */
24702 #if CYTHON_PROFILE
24703 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24704  PyFrameObject** frame,
24705  PyThreadState* tstate,
24706  const char *funcname,
24707  const char *srcfile,
24708  int firstlineno) {
24709  PyObject *type, *value, *traceback;
24710  int retval;
24711  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24712  if (*code == NULL) {
24713  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24714  if (*code == NULL) return 0;
24715  }
24716  *frame = PyFrame_New(
24717  tstate, /*PyThreadState *tstate*/
24718  *code, /*PyCodeObject *code*/
24719  __pyx_d, /*PyObject *globals*/
24720  0 /*PyObject *locals*/
24721  );
24722  if (*frame == NULL) return 0;
24723  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24724  Py_INCREF(Py_None);
24725  (*frame)->f_trace = Py_None;
24726  }
24727 #if PY_VERSION_HEX < 0x030400B1
24728  } else {
24729  (*frame)->f_tstate = tstate;
24730 #endif
24731  }
24732  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24733  retval = 1;
24734  tstate->tracing++;
24735  tstate->use_tracing = 0;
24736  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24737  #if CYTHON_TRACE
24738  if (tstate->c_tracefunc)
24739  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24740  if (retval && tstate->c_profilefunc)
24741  #endif
24742  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24743  tstate->use_tracing = (tstate->c_profilefunc ||
24744  (CYTHON_TRACE && tstate->c_tracefunc));
24745  tstate->tracing--;
24746  if (retval) {
24747  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24748  return tstate->use_tracing && retval;
24749  } else {
24750  Py_XDECREF(type);
24751  Py_XDECREF(value);
24752  Py_XDECREF(traceback);
24753  return -1;
24754  }
24755 }
24756 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
24757  PyCodeObject *py_code = 0;
24758 #if PY_MAJOR_VERSION >= 3
24759  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24760  if (likely(py_code)) {
24761  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24762  }
24763 #else
24764  PyObject *py_srcfile = 0;
24765  PyObject *py_funcname = 0;
24766  py_funcname = PyString_FromString(funcname);
24767  if (unlikely(!py_funcname)) goto bad;
24768  py_srcfile = PyString_FromString(srcfile);
24769  if (unlikely(!py_srcfile)) goto bad;
24770  py_code = PyCode_New(
24771  0,
24772  0,
24773  0,
24774  CO_OPTIMIZED | CO_NEWLOCALS,
24775  __pyx_empty_bytes, /*PyObject *code,*/
24776  __pyx_empty_tuple, /*PyObject *consts,*/
24777  __pyx_empty_tuple, /*PyObject *names,*/
24778  __pyx_empty_tuple, /*PyObject *varnames,*/
24779  __pyx_empty_tuple, /*PyObject *freevars,*/
24780  __pyx_empty_tuple, /*PyObject *cellvars,*/
24781  py_srcfile, /*PyObject *filename,*/
24782  py_funcname, /*PyObject *name,*/
24783  firstlineno,
24784  __pyx_empty_bytes /*PyObject *lnotab*/
24785  );
24786 bad:
24787  Py_XDECREF(py_srcfile);
24788  Py_XDECREF(py_funcname);
24789 #endif
24790  return py_code;
24791 }
24792 #endif
24793 
24794 /* GetItemInt */
24795 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24796  PyObject *r;
24797  if (!j) return NULL;
24798  r = PyObject_GetItem(o, j);
24799  Py_DECREF(j);
24800  return r;
24801 }
24802 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24803  CYTHON_NCP_UNUSED int wraparound,
24804  CYTHON_NCP_UNUSED int boundscheck) {
24805 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24806  Py_ssize_t wrapped_i = i;
24807  if (wraparound & unlikely(i < 0)) {
24808  wrapped_i += PyList_GET_SIZE(o);
24809  }
24810  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24811  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24812  Py_INCREF(r);
24813  return r;
24814  }
24815  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24816 #else
24817  return PySequence_GetItem(o, i);
24818 #endif
24819 }
24820 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24821  CYTHON_NCP_UNUSED int wraparound,
24822  CYTHON_NCP_UNUSED int boundscheck) {
24823 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24824  Py_ssize_t wrapped_i = i;
24825  if (wraparound & unlikely(i < 0)) {
24826  wrapped_i += PyTuple_GET_SIZE(o);
24827  }
24828  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24829  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24830  Py_INCREF(r);
24831  return r;
24832  }
24833  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24834 #else
24835  return PySequence_GetItem(o, i);
24836 #endif
24837 }
24838 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24839  CYTHON_NCP_UNUSED int wraparound,
24840  CYTHON_NCP_UNUSED int boundscheck) {
24841 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24842  if (is_list || PyList_CheckExact(o)) {
24843  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24844  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24845  PyObject *r = PyList_GET_ITEM(o, n);
24846  Py_INCREF(r);
24847  return r;
24848  }
24849  }
24850  else if (PyTuple_CheckExact(o)) {
24851  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24852  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24853  PyObject *r = PyTuple_GET_ITEM(o, n);
24854  Py_INCREF(r);
24855  return r;
24856  }
24857  } else {
24858  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24859  if (likely(m && m->sq_item)) {
24860  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24861  Py_ssize_t l = m->sq_length(o);
24862  if (likely(l >= 0)) {
24863  i += l;
24864  } else {
24865  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24866  return NULL;
24867  PyErr_Clear();
24868  }
24869  }
24870  return m->sq_item(o, i);
24871  }
24872  }
24873 #else
24874  if (is_list || PySequence_Check(o)) {
24875  return PySequence_GetItem(o, i);
24876  }
24877 #endif
24878  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24879 }
24880 
24881 /* ObjectGetItem */
24882 #if CYTHON_USE_TYPE_SLOTS
24883 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24884  PyObject *runerr;
24885  Py_ssize_t key_value;
24886  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24887  if (unlikely(!(m && m->sq_item))) {
24888  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24889  return NULL;
24890  }
24891  key_value = __Pyx_PyIndex_AsSsize_t(index);
24892  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24893  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24894  }
24895  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24896  PyErr_Clear();
24897  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24898  }
24899  return NULL;
24900 }
24901 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24902  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24903  if (likely(m && m->mp_subscript)) {
24904  return m->mp_subscript(obj, key);
24905  }
24906  return __Pyx_PyObject_GetIndex(obj, key);
24907 }
24908 #endif
24909 
24910 /* MemviewSliceInit */
24911 static int
24912 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24913  int ndim,
24914  __Pyx_memviewslice *memviewslice,
24915  int memview_is_new_reference)
24916 {
24917  __Pyx_RefNannyDeclarations
24918  int i, retval=-1;
24919  Py_buffer *buf = &memview->view;
24920  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24921  if (unlikely(memviewslice->memview || memviewslice->data)) {
24922  PyErr_SetString(PyExc_ValueError,
24923  "memviewslice is already initialized!");
24924  goto fail;
24925  }
24926  if (buf->strides) {
24927  for (i = 0; i < ndim; i++) {
24928  memviewslice->strides[i] = buf->strides[i];
24929  }
24930  } else {
24931  Py_ssize_t stride = buf->itemsize;
24932  for (i = ndim - 1; i >= 0; i--) {
24933  memviewslice->strides[i] = stride;
24934  stride *= buf->shape[i];
24935  }
24936  }
24937  for (i = 0; i < ndim; i++) {
24938  memviewslice->shape[i] = buf->shape[i];
24939  if (buf->suboffsets) {
24940  memviewslice->suboffsets[i] = buf->suboffsets[i];
24941  } else {
24942  memviewslice->suboffsets[i] = -1;
24943  }
24944  }
24945  memviewslice->memview = memview;
24946  memviewslice->data = (char *)buf->buf;
24947  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24948  Py_INCREF(memview);
24949  }
24950  retval = 0;
24951  goto no_fail;
24952 fail:
24953  memviewslice->memview = 0;
24954  memviewslice->data = 0;
24955  retval = -1;
24956 no_fail:
24957  __Pyx_RefNannyFinishContext();
24958  return retval;
24959 }
24960 #ifndef Py_NO_RETURN
24961 #define Py_NO_RETURN
24962 #endif
24963 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24964  va_list vargs;
24965  char msg[200];
24966 #ifdef HAVE_STDARG_PROTOTYPES
24967  va_start(vargs, fmt);
24968 #else
24969  va_start(vargs);
24970 #endif
24971  vsnprintf(msg, 200, fmt, vargs);
24972  va_end(vargs);
24973  Py_FatalError(msg);
24974 }
24975 static CYTHON_INLINE int
24976 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24977  PyThread_type_lock lock)
24978 {
24979  int result;
24980  PyThread_acquire_lock(lock, 1);
24981  result = (*acquisition_count)++;
24982  PyThread_release_lock(lock);
24983  return result;
24984 }
24985 static CYTHON_INLINE int
24986 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24987  PyThread_type_lock lock)
24988 {
24989  int result;
24990  PyThread_acquire_lock(lock, 1);
24991  result = (*acquisition_count)--;
24992  PyThread_release_lock(lock);
24993  return result;
24994 }
24995 static CYTHON_INLINE void
24996 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24997 {
24998  int first_time;
24999  struct __pyx_memoryview_obj *memview = memslice->memview;
25000  if (unlikely(!memview || (PyObject *) memview == Py_None))
25001  return;
25002  if (unlikely(__pyx_get_slice_count(memview) < 0))
25003  __pyx_fatalerror("Acquisition count is %d (line %d)",
25004  __pyx_get_slice_count(memview), lineno);
25005  first_time = __pyx_add_acquisition_count(memview) == 0;
25006  if (unlikely(first_time)) {
25007  if (have_gil) {
25008  Py_INCREF((PyObject *) memview);
25009  } else {
25010  PyGILState_STATE _gilstate = PyGILState_Ensure();
25011  Py_INCREF((PyObject *) memview);
25012  PyGILState_Release(_gilstate);
25013  }
25014  }
25015 }
25016 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25017  int have_gil, int lineno) {
25018  int last_time;
25019  struct __pyx_memoryview_obj *memview = memslice->memview;
25020  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
25021  memslice->memview = NULL;
25022  return;
25023  }
25024  if (unlikely(__pyx_get_slice_count(memview) <= 0))
25025  __pyx_fatalerror("Acquisition count is %d (line %d)",
25026  __pyx_get_slice_count(memview), lineno);
25027  last_time = __pyx_sub_acquisition_count(memview) == 1;
25028  memslice->data = NULL;
25029  if (unlikely(last_time)) {
25030  if (have_gil) {
25031  Py_CLEAR(memslice->memview);
25032  } else {
25033  PyGILState_STATE _gilstate = PyGILState_Ensure();
25034  Py_CLEAR(memslice->memview);
25035  PyGILState_Release(_gilstate);
25036  }
25037  } else {
25038  memslice->memview = NULL;
25039  }
25040 }
25041 
25042 /* Import */
25043 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25044  PyObject *empty_list = 0;
25045  PyObject *module = 0;
25046  PyObject *global_dict = 0;
25047  PyObject *empty_dict = 0;
25048  PyObject *list;
25049  #if PY_MAJOR_VERSION < 3
25050  PyObject *py_import;
25051  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25052  if (!py_import)
25053  goto bad;
25054  #endif
25055  if (from_list)
25056  list = from_list;
25057  else {
25058  empty_list = PyList_New(0);
25059  if (!empty_list)
25060  goto bad;
25061  list = empty_list;
25062  }
25063  global_dict = PyModule_GetDict(__pyx_m);
25064  if (!global_dict)
25065  goto bad;
25066  empty_dict = PyDict_New();
25067  if (!empty_dict)
25068  goto bad;
25069  {
25070  #if PY_MAJOR_VERSION >= 3
25071  if (level == -1) {
25072  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25073  module = PyImport_ImportModuleLevelObject(
25074  name, global_dict, empty_dict, list, 1);
25075  if (!module) {
25076  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25077  goto bad;
25078  PyErr_Clear();
25079  }
25080  }
25081  level = 0;
25082  }
25083  #endif
25084  if (!module) {
25085  #if PY_MAJOR_VERSION < 3
25086  PyObject *py_level = PyInt_FromLong(level);
25087  if (!py_level)
25088  goto bad;
25089  module = PyObject_CallFunctionObjArgs(py_import,
25090  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25091  Py_DECREF(py_level);
25092  #else
25093  module = PyImport_ImportModuleLevelObject(
25094  name, global_dict, empty_dict, list, level);
25095  #endif
25096  }
25097  }
25098 bad:
25099  #if PY_MAJOR_VERSION < 3
25100  Py_XDECREF(py_import);
25101  #endif
25102  Py_XDECREF(empty_list);
25103  Py_XDECREF(empty_dict);
25104  return module;
25105 }
25106 
25107 /* ImportFrom */
25108 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25109  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25110  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25111  PyErr_Format(PyExc_ImportError,
25112  #if PY_MAJOR_VERSION < 3
25113  "cannot import name %.230s", PyString_AS_STRING(name));
25114  #else
25115  "cannot import name %S", name);
25116  #endif
25117  }
25118  return value;
25119 }
25120 
25121 /* PyFunctionFastCall */
25122 #if CYTHON_FAST_PYCALL
25123 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25124  PyObject *globals) {
25125  PyFrameObject *f;
25126  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25127  PyObject **fastlocals;
25128  Py_ssize_t i;
25129  PyObject *result;
25130  assert(globals != NULL);
25131  /* XXX Perhaps we should create a specialized
25132  PyFrame_New() that doesn't take locals, but does
25133  take builtins without sanity checking them.
25134  */
25135  assert(tstate != NULL);
25136  f = PyFrame_New(tstate, co, globals, NULL);
25137  if (f == NULL) {
25138  return NULL;
25139  }
25140  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
25141  for (i = 0; i < na; i++) {
25142  Py_INCREF(*args);
25143  fastlocals[i] = *args++;
25144  }
25145  result = PyEval_EvalFrameEx(f,0);
25146  ++tstate->recursion_depth;
25147  Py_DECREF(f);
25148  --tstate->recursion_depth;
25149  return result;
25150 }
25151 #if 1 || PY_VERSION_HEX < 0x030600B1
25152 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
25153  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25154  PyObject *globals = PyFunction_GET_GLOBALS(func);
25155  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25156  PyObject *closure;
25157 #if PY_MAJOR_VERSION >= 3
25158  PyObject *kwdefs;
25159 #endif
25160  PyObject *kwtuple, **k;
25161  PyObject **d;
25162  Py_ssize_t nd;
25163  Py_ssize_t nk;
25164  PyObject *result;
25165  assert(kwargs == NULL || PyDict_Check(kwargs));
25166  nk = kwargs ? PyDict_Size(kwargs) : 0;
25167  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
25168  return NULL;
25169  }
25170  if (
25171 #if PY_MAJOR_VERSION >= 3
25172  co->co_kwonlyargcount == 0 &&
25173 #endif
25174  likely(kwargs == NULL || nk == 0) &&
25175  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25176  if (argdefs == NULL && co->co_argcount == nargs) {
25177  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25178  goto done;
25179  }
25180  else if (nargs == 0 && argdefs != NULL
25181  && co->co_argcount == Py_SIZE(argdefs)) {
25182  /* function called with no arguments, but all parameters have
25183  a default value: use default values as arguments .*/
25184  args = &PyTuple_GET_ITEM(argdefs, 0);
25185  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25186  goto done;
25187  }
25188  }
25189  if (kwargs != NULL) {
25190  Py_ssize_t pos, i;
25191  kwtuple = PyTuple_New(2 * nk);
25192  if (kwtuple == NULL) {
25193  result = NULL;
25194  goto done;
25195  }
25196  k = &PyTuple_GET_ITEM(kwtuple, 0);
25197  pos = i = 0;
25198  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
25199  Py_INCREF(k[i]);
25200  Py_INCREF(k[i+1]);
25201  i += 2;
25202  }
25203  nk = i / 2;
25204  }
25205  else {
25206  kwtuple = NULL;
25207  k = NULL;
25208  }
25209  closure = PyFunction_GET_CLOSURE(func);
25210 #if PY_MAJOR_VERSION >= 3
25211  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25212 #endif
25213  if (argdefs != NULL) {
25214  d = &PyTuple_GET_ITEM(argdefs, 0);
25215  nd = Py_SIZE(argdefs);
25216  }
25217  else {
25218  d = NULL;
25219  nd = 0;
25220  }
25221 #if PY_MAJOR_VERSION >= 3
25222  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25223  args, (int)nargs,
25224  k, (int)nk,
25225  d, (int)nd, kwdefs, closure);
25226 #else
25227  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25228  args, (int)nargs,
25229  k, (int)nk,
25230  d, (int)nd, closure);
25231 #endif
25232  Py_XDECREF(kwtuple);
25233 done:
25234  Py_LeaveRecursiveCall();
25235  return result;
25236 }
25237 #endif
25238 #endif
25239 
25240 /* PyObjectCall */
25241 #if CYTHON_COMPILING_IN_CPYTHON
25242 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25243  PyObject *result;
25244  ternaryfunc call = func->ob_type->tp_call;
25245  if (unlikely(!call))
25246  return PyObject_Call(func, arg, kw);
25247  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
25248  return NULL;
25249  result = (*call)(func, arg, kw);
25250  Py_LeaveRecursiveCall();
25251  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25252  PyErr_SetString(
25253  PyExc_SystemError,
25254  "NULL result without error in PyObject_Call");
25255  }
25256  return result;
25257 }
25258 #endif
25259 
25260 /* PyObjectCallMethO */
25261 #if CYTHON_COMPILING_IN_CPYTHON
25262 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25263  PyObject *self, *result;
25264  PyCFunction cfunc;
25265  cfunc = PyCFunction_GET_FUNCTION(func);
25266  self = PyCFunction_GET_SELF(func);
25267  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
25268  return NULL;
25269  result = cfunc(self, arg);
25270  Py_LeaveRecursiveCall();
25271  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25272  PyErr_SetString(
25273  PyExc_SystemError,
25274  "NULL result without error in PyObject_Call");
25275  }
25276  return result;
25277 }
25278 #endif
25279 
25280 /* PyObjectCallNoArg */
25281 #if CYTHON_COMPILING_IN_CPYTHON
25282 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
25283 #if CYTHON_FAST_PYCALL
25284  if (PyFunction_Check(func)) {
25285  return __Pyx_PyFunction_FastCall(func, NULL, 0);
25286  }
25287 #endif
25288 #ifdef __Pyx_CyFunction_USED
25289  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
25290 #else
25291  if (likely(PyCFunction_Check(func)))
25292 #endif
25293  {
25294  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
25295  return __Pyx_PyObject_CallMethO(func, NULL);
25296  }
25297  }
25298  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
25299 }
25300 #endif
25301 
25302 /* PyCFunctionFastCall */
25303 #if CYTHON_FAST_PYCCALL
25304 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25305  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25306  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25307  PyObject *self = PyCFunction_GET_SELF(func);
25308  int flags = PyCFunction_GET_FLAGS(func);
25309  assert(PyCFunction_Check(func));
25310  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
25311  assert(nargs >= 0);
25312  assert(nargs == 0 || args != NULL);
25313  /* _PyCFunction_FastCallDict() must not be called with an exception set,
25314  because it may clear it (directly or indirectly) and so the
25315  caller loses its exception */
25316  assert(!PyErr_Occurred());
25317  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
25318  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
25319  } else {
25320  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
25321  }
25322 }
25323 #endif
25324 
25325 /* PyObjectCallOneArg */
25326 #if CYTHON_COMPILING_IN_CPYTHON
25327 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25328  PyObject *result;
25329  PyObject *args = PyTuple_New(1);
25330  if (unlikely(!args)) return NULL;
25331  Py_INCREF(arg);
25332  PyTuple_SET_ITEM(args, 0, arg);
25333  result = __Pyx_PyObject_Call(func, args, NULL);
25334  Py_DECREF(args);
25335  return result;
25336 }
25337 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25338 #if CYTHON_FAST_PYCALL
25339  if (PyFunction_Check(func)) {
25340  return __Pyx_PyFunction_FastCall(func, &arg, 1);
25341  }
25342 #endif
25343  if (likely(PyCFunction_Check(func))) {
25344  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25345  return __Pyx_PyObject_CallMethO(func, arg);
25346 #if CYTHON_FAST_PYCCALL
25347  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25348  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25349 #endif
25350  }
25351  }
25352  return __Pyx__PyObject_CallOneArg(func, arg);
25353 }
25354 #else
25355 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25356  PyObject *result;
25357  PyObject *args = PyTuple_Pack(1, arg);
25358  if (unlikely(!args)) return NULL;
25359  result = __Pyx_PyObject_Call(func, args, NULL);
25360  Py_DECREF(args);
25361  return result;
25362 }
25363 #endif
25364 
25365 /* PyErrExceptionMatches */
25366 #if CYTHON_FAST_THREAD_STATE
25367 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25368  Py_ssize_t i, n;
25369  n = PyTuple_GET_SIZE(tuple);
25370 #if PY_MAJOR_VERSION >= 3
25371  for (i=0; i<n; i++) {
25372  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25373  }
25374 #endif
25375  for (i=0; i<n; i++) {
25376  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25377  }
25378  return 0;
25379 }
25380 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25381  PyObject *exc_type = tstate->curexc_type;
25382  if (exc_type == err) return 1;
25383  if (unlikely(!exc_type)) return 0;
25384  if (unlikely(PyTuple_Check(err)))
25385  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25386  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25387 }
25388 #endif
25389 
25390 /* GetAttr */
25391 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25392 #if CYTHON_USE_TYPE_SLOTS
25393 #if PY_MAJOR_VERSION >= 3
25394  if (likely(PyUnicode_Check(n)))
25395 #else
25396  if (likely(PyString_Check(n)))
25397 #endif
25398  return __Pyx_PyObject_GetAttrStr(o, n);
25399 #endif
25400  return PyObject_GetAttr(o, n);
25401 }
25402 
25403 /* GetAttr3 */
25404 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25405  __Pyx_PyThreadState_declare
25406  __Pyx_PyThreadState_assign
25407  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25408  return NULL;
25409  __Pyx_PyErr_Clear();
25410  Py_INCREF(d);
25411  return d;
25412 }
25413 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25414  PyObject *r = __Pyx_GetAttr(o, n);
25415  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25416 }
25417 
25418 /* PyDictVersioning */
25419 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25420 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25421  PyObject *dict = Py_TYPE(obj)->tp_dict;
25422  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25423 }
25424 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25425  PyObject **dictptr = NULL;
25426  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25427  if (offset) {
25428 #if CYTHON_COMPILING_IN_CPYTHON
25429  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
25430 #else
25431  dictptr = _PyObject_GetDictPtr(obj);
25432 #endif
25433  }
25434  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25435 }
25436 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25437  PyObject *dict = Py_TYPE(obj)->tp_dict;
25438  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25439  return 0;
25440  return obj_dict_version == __Pyx_get_object_dict_version(obj);
25441 }
25442 #endif
25443 
25444 /* GetModuleGlobalName */
25445 #if CYTHON_USE_DICT_VERSIONS
25446 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25447 #else
25448 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25449 #endif
25450 {
25451  PyObject *result;
25452 #if !CYTHON_AVOID_BORROWED_REFS
25453 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25454  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25455  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25456  if (likely(result)) {
25457  return __Pyx_NewRef(result);
25458  } else if (unlikely(PyErr_Occurred())) {
25459  return NULL;
25460  }
25461 #else
25462  result = PyDict_GetItem(__pyx_d, name);
25463  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25464  if (likely(result)) {
25465  return __Pyx_NewRef(result);
25466  }
25467 #endif
25468 #else
25469  result = PyObject_GetItem(__pyx_d, name);
25470  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25471  if (likely(result)) {
25472  return __Pyx_NewRef(result);
25473  }
25474  PyErr_Clear();
25475 #endif
25476  return __Pyx_GetBuiltinName(name);
25477 }
25478 
25479 /* KeywordStringCheck */
25480 static int __Pyx_CheckKeywordStrings(
25481  PyObject *kwdict,
25482  const char* function_name,
25483  int kw_allowed)
25484 {
25485  PyObject* key = 0;
25486  Py_ssize_t pos = 0;
25487 #if CYTHON_COMPILING_IN_PYPY
25488  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
25489  goto invalid_keyword;
25490  return 1;
25491 #else
25492  while (PyDict_Next(kwdict, &pos, &key, 0)) {
25493  #if PY_MAJOR_VERSION < 3
25494  if (unlikely(!PyString_Check(key)))
25495  #endif
25496  if (unlikely(!PyUnicode_Check(key)))
25497  goto invalid_keyword_type;
25498  }
25499  if ((!kw_allowed) && unlikely(key))
25500  goto invalid_keyword;
25501  return 1;
25502 invalid_keyword_type:
25503  PyErr_Format(PyExc_TypeError,
25504  "%.200s() keywords must be strings", function_name);
25505  return 0;
25506 #endif
25507 invalid_keyword:
25508  PyErr_Format(PyExc_TypeError,
25509  #if PY_MAJOR_VERSION < 3
25510  "%.200s() got an unexpected keyword argument '%.200s'",
25511  function_name, PyString_AsString(key));
25512  #else
25513  "%s() got an unexpected keyword argument '%U'",
25514  function_name, key);
25515  #endif
25516  return 0;
25517 }
25518 
25519 /* WriteUnraisableException */
25520 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25521  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25522  int full_traceback, CYTHON_UNUSED int nogil) {
25523  PyObject *old_exc, *old_val, *old_tb;
25524  PyObject *ctx;
25525  __Pyx_PyThreadState_declare
25526 #ifdef WITH_THREAD
25527  PyGILState_STATE state;
25528  if (nogil)
25529  state = PyGILState_Ensure();
25530 #ifdef _MSC_VER
25531  else state = (PyGILState_STATE)-1;
25532 #endif
25533 #endif
25534  __Pyx_PyThreadState_assign
25535  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25536  if (full_traceback) {
25537  Py_XINCREF(old_exc);
25538  Py_XINCREF(old_val);
25539  Py_XINCREF(old_tb);
25540  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25541  PyErr_PrintEx(1);
25542  }
25543  #if PY_MAJOR_VERSION < 3
25544  ctx = PyString_FromString(name);
25545  #else
25546  ctx = PyUnicode_FromString(name);
25547  #endif
25548  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25549  if (!ctx) {
25550  PyErr_WriteUnraisable(Py_None);
25551  } else {
25552  PyErr_WriteUnraisable(ctx);
25553  Py_DECREF(ctx);
25554  }
25555 #ifdef WITH_THREAD
25556  if (nogil)
25557  PyGILState_Release(state);
25558 #endif
25559 }
25560 
25561 /* None */
25562 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
25563  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
25564 }
25565 
25566 /* FetchCommonType */
25567 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25568  PyObject* fake_module;
25569  PyTypeObject* cached_type = NULL;
25570  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25571  if (!fake_module) return NULL;
25572  Py_INCREF(fake_module);
25573  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25574  if (cached_type) {
25575  if (!PyType_Check((PyObject*)cached_type)) {
25576  PyErr_Format(PyExc_TypeError,
25577  "Shared Cython type %.200s is not a type object",
25578  type->tp_name);
25579  goto bad;
25580  }
25581  if (cached_type->tp_basicsize != type->tp_basicsize) {
25582  PyErr_Format(PyExc_TypeError,
25583  "Shared Cython type %.200s has the wrong size, try recompiling",
25584  type->tp_name);
25585  goto bad;
25586  }
25587  } else {
25588  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25589  PyErr_Clear();
25590  if (PyType_Ready(type) < 0) goto bad;
25591  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25592  goto bad;
25593  Py_INCREF(type);
25594  cached_type = type;
25595  }
25596 done:
25597  Py_DECREF(fake_module);
25598  return cached_type;
25599 bad:
25600  Py_XDECREF(cached_type);
25601  cached_type = NULL;
25602  goto done;
25603 }
25604 
25605 /* CythonFunctionShared */
25606 #include <structmember.h>
25607 static PyObject *
25608 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25609 {
25610  if (unlikely(op->func_doc == NULL)) {
25611  if (op->func.m_ml->ml_doc) {
25612 #if PY_MAJOR_VERSION >= 3
25613  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25614 #else
25615  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25616 #endif
25617  if (unlikely(op->func_doc == NULL))
25618  return NULL;
25619  } else {
25620  Py_INCREF(Py_None);
25621  return Py_None;
25622  }
25623  }
25624  Py_INCREF(op->func_doc);
25625  return op->func_doc;
25626 }
25627 static int
25628 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25629 {
25630  PyObject *tmp = op->func_doc;
25631  if (value == NULL) {
25632  value = Py_None;
25633  }
25634  Py_INCREF(value);
25635  op->func_doc = value;
25636  Py_XDECREF(tmp);
25637  return 0;
25638 }
25639 static PyObject *
25640 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25641 {
25642  if (unlikely(op->func_name == NULL)) {
25643 #if PY_MAJOR_VERSION >= 3
25644  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25645 #else
25646  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25647 #endif
25648  if (unlikely(op->func_name == NULL))
25649  return NULL;
25650  }
25651  Py_INCREF(op->func_name);
25652  return op->func_name;
25653 }
25654 static int
25655 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25656 {
25657  PyObject *tmp;
25658 #if PY_MAJOR_VERSION >= 3
25659  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25660 #else
25661  if (unlikely(value == NULL || !PyString_Check(value)))
25662 #endif
25663  {
25664  PyErr_SetString(PyExc_TypeError,
25665  "__name__ must be set to a string object");
25666  return -1;
25667  }
25668  tmp = op->func_name;
25669  Py_INCREF(value);
25670  op->func_name = value;
25671  Py_XDECREF(tmp);
25672  return 0;
25673 }
25674 static PyObject *
25675 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25676 {
25677  Py_INCREF(op->func_qualname);
25678  return op->func_qualname;
25679 }
25680 static int
25681 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25682 {
25683  PyObject *tmp;
25684 #if PY_MAJOR_VERSION >= 3
25685  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25686 #else
25687  if (unlikely(value == NULL || !PyString_Check(value)))
25688 #endif
25689  {
25690  PyErr_SetString(PyExc_TypeError,
25691  "__qualname__ must be set to a string object");
25692  return -1;
25693  }
25694  tmp = op->func_qualname;
25695  Py_INCREF(value);
25696  op->func_qualname = value;
25697  Py_XDECREF(tmp);
25698  return 0;
25699 }
25700 static PyObject *
25701 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25702 {
25703  PyObject *self;
25704  self = m->func_closure;
25705  if (self == NULL)
25706  self = Py_None;
25707  Py_INCREF(self);
25708  return self;
25709 }
25710 static PyObject *
25711 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25712 {
25713  if (unlikely(op->func_dict == NULL)) {
25714  op->func_dict = PyDict_New();
25715  if (unlikely(op->func_dict == NULL))
25716  return NULL;
25717  }
25718  Py_INCREF(op->func_dict);
25719  return op->func_dict;
25720 }
25721 static int
25722 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25723 {
25724  PyObject *tmp;
25725  if (unlikely(value == NULL)) {
25726  PyErr_SetString(PyExc_TypeError,
25727  "function's dictionary may not be deleted");
25728  return -1;
25729  }
25730  if (unlikely(!PyDict_Check(value))) {
25731  PyErr_SetString(PyExc_TypeError,
25732  "setting function's dictionary to a non-dict");
25733  return -1;
25734  }
25735  tmp = op->func_dict;
25736  Py_INCREF(value);
25737  op->func_dict = value;
25738  Py_XDECREF(tmp);
25739  return 0;
25740 }
25741 static PyObject *
25742 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25743 {
25744  Py_INCREF(op->func_globals);
25745  return op->func_globals;
25746 }
25747 static PyObject *
25748 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25749 {
25750  Py_INCREF(Py_None);
25751  return Py_None;
25752 }
25753 static PyObject *
25754 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25755 {
25756  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25757  Py_INCREF(result);
25758  return result;
25759 }
25760 static int
25761 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25762  int result = 0;
25763  PyObject *res = op->defaults_getter((PyObject *) op);
25764  if (unlikely(!res))
25765  return -1;
25766  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25767  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25768  Py_INCREF(op->defaults_tuple);
25769  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25770  Py_INCREF(op->defaults_kwdict);
25771  #else
25772  op->defaults_tuple = PySequence_ITEM(res, 0);
25773  if (unlikely(!op->defaults_tuple)) result = -1;
25774  else {
25775  op->defaults_kwdict = PySequence_ITEM(res, 1);
25776  if (unlikely(!op->defaults_kwdict)) result = -1;
25777  }
25778  #endif
25779  Py_DECREF(res);
25780  return result;
25781 }
25782 static int
25783 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25784  PyObject* tmp;
25785  if (!value) {
25786  value = Py_None;
25787  } else if (value != Py_None && !PyTuple_Check(value)) {
25788  PyErr_SetString(PyExc_TypeError,
25789  "__defaults__ must be set to a tuple object");
25790  return -1;
25791  }
25792  Py_INCREF(value);
25793  tmp = op->defaults_tuple;
25794  op->defaults_tuple = value;
25795  Py_XDECREF(tmp);
25796  return 0;
25797 }
25798 static PyObject *
25799 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25800  PyObject* result = op->defaults_tuple;
25801  if (unlikely(!result)) {
25802  if (op->defaults_getter) {
25803  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25804  result = op->defaults_tuple;
25805  } else {
25806  result = Py_None;
25807  }
25808  }
25809  Py_INCREF(result);
25810  return result;
25811 }
25812 static int
25813 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25814  PyObject* tmp;
25815  if (!value) {
25816  value = Py_None;
25817  } else if (value != Py_None && !PyDict_Check(value)) {
25818  PyErr_SetString(PyExc_TypeError,
25819  "__kwdefaults__ must be set to a dict object");
25820  return -1;
25821  }
25822  Py_INCREF(value);
25823  tmp = op->defaults_kwdict;
25824  op->defaults_kwdict = value;
25825  Py_XDECREF(tmp);
25826  return 0;
25827 }
25828 static PyObject *
25829 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25830  PyObject* result = op->defaults_kwdict;
25831  if (unlikely(!result)) {
25832  if (op->defaults_getter) {
25833  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25834  result = op->defaults_kwdict;
25835  } else {
25836  result = Py_None;
25837  }
25838  }
25839  Py_INCREF(result);
25840  return result;
25841 }
25842 static int
25843 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25844  PyObject* tmp;
25845  if (!value || value == Py_None) {
25846  value = NULL;
25847  } else if (!PyDict_Check(value)) {
25848  PyErr_SetString(PyExc_TypeError,
25849  "__annotations__ must be set to a dict object");
25850  return -1;
25851  }
25852  Py_XINCREF(value);
25853  tmp = op->func_annotations;
25854  op->func_annotations = value;
25855  Py_XDECREF(tmp);
25856  return 0;
25857 }
25858 static PyObject *
25859 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25860  PyObject* result = op->func_annotations;
25861  if (unlikely(!result)) {
25862  result = PyDict_New();
25863  if (unlikely(!result)) return NULL;
25864  op->func_annotations = result;
25865  }
25866  Py_INCREF(result);
25867  return result;
25868 }
25869 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25870  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25871  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25872  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25873  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25874  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25875  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25876  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25877  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25878  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25879  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25880  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25881  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25882  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25883  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25884  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25885  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25886  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25887  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25888  {0, 0, 0, 0, 0}
25889 };
25890 static PyMemberDef __pyx_CyFunction_members[] = {
25891  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25892  {0, 0, 0, 0, 0}
25893 };
25894 static PyObject *
25895 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25896 {
25897 #if PY_MAJOR_VERSION >= 3
25898  return PyUnicode_FromString(m->func.m_ml->ml_name);
25899 #else
25900  return PyString_FromString(m->func.m_ml->ml_name);
25901 #endif
25902 }
25903 static PyMethodDef __pyx_CyFunction_methods[] = {
25904  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25905  {0, 0, 0, 0}
25906 };
25907 #if PY_VERSION_HEX < 0x030500A0
25908 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25909 #else
25910 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25911 #endif
25912 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
25913  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25914  if (unlikely(op == NULL))
25915  return NULL;
25916  op->flags = flags;
25917  __Pyx_CyFunction_weakreflist(op) = NULL;
25918  op->func.m_ml = ml;
25919  op->func.m_self = (PyObject *) op;
25920  Py_XINCREF(closure);
25921  op->func_closure = closure;
25922  Py_XINCREF(module);
25923  op->func.m_module = module;
25924  op->func_dict = NULL;
25925  op->func_name = NULL;
25926  Py_INCREF(qualname);
25927  op->func_qualname = qualname;
25928  op->func_doc = NULL;
25929  op->func_classobj = NULL;
25930  op->func_globals = globals;
25931  Py_INCREF(op->func_globals);
25932  Py_XINCREF(code);
25933  op->func_code = code;
25934  op->defaults_pyobjects = 0;
25935  op->defaults_size = 0;
25936  op->defaults = NULL;
25937  op->defaults_tuple = NULL;
25938  op->defaults_kwdict = NULL;
25939  op->defaults_getter = NULL;
25940  op->func_annotations = NULL;
25941  return (PyObject *) op;
25942 }
25943 static int
25944 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25945 {
25946  Py_CLEAR(m->func_closure);
25947  Py_CLEAR(m->func.m_module);
25948  Py_CLEAR(m->func_dict);
25949  Py_CLEAR(m->func_name);
25950  Py_CLEAR(m->func_qualname);
25951  Py_CLEAR(m->func_doc);
25952  Py_CLEAR(m->func_globals);
25953  Py_CLEAR(m->func_code);
25954  Py_CLEAR(m->func_classobj);
25955  Py_CLEAR(m->defaults_tuple);
25956  Py_CLEAR(m->defaults_kwdict);
25957  Py_CLEAR(m->func_annotations);
25958  if (m->defaults) {
25959  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25960  int i;
25961  for (i = 0; i < m->defaults_pyobjects; i++)
25962  Py_XDECREF(pydefaults[i]);
25963  PyObject_Free(m->defaults);
25964  m->defaults = NULL;
25965  }
25966  return 0;
25967 }
25968 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25969 {
25970  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25971  PyObject_ClearWeakRefs((PyObject *) m);
25972  __Pyx_CyFunction_clear(m);
25973  PyObject_GC_Del(m);
25974 }
25975 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25976 {
25977  PyObject_GC_UnTrack(m);
25978  __Pyx__CyFunction_dealloc(m);
25979 }
25980 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25981 {
25982  Py_VISIT(m->func_closure);
25983  Py_VISIT(m->func.m_module);
25984  Py_VISIT(m->func_dict);
25985  Py_VISIT(m->func_name);
25986  Py_VISIT(m->func_qualname);
25987  Py_VISIT(m->func_doc);
25988  Py_VISIT(m->func_globals);
25989  Py_VISIT(m->func_code);
25990  Py_VISIT(m->func_classobj);
25991  Py_VISIT(m->defaults_tuple);
25992  Py_VISIT(m->defaults_kwdict);
25993  if (m->defaults) {
25994  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25995  int i;
25996  for (i = 0; i < m->defaults_pyobjects; i++)
25997  Py_VISIT(pydefaults[i]);
25998  }
25999  return 0;
26000 }
26001 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26002 {
26003 #if PY_MAJOR_VERSION < 3
26004  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26005  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26006  Py_INCREF(func);
26007  return func;
26008  }
26009  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26010  if (type == NULL)
26011  type = (PyObject *)(Py_TYPE(obj));
26012  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26013  }
26014  if (obj == Py_None)
26015  obj = NULL;
26016 #endif
26017  return __Pyx_PyMethod_New(func, obj, type);
26018 }
26019 static PyObject*
26020 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26021 {
26022 #if PY_MAJOR_VERSION >= 3
26023  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26024  op->func_qualname, (void *)op);
26025 #else
26026  return PyString_FromFormat("<cyfunction %s at %p>",
26027  PyString_AsString(op->func_qualname), (void *)op);
26028 #endif
26029 }
26030 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26031  PyCFunctionObject* f = (PyCFunctionObject*)func;
26032  PyCFunction meth = f->m_ml->ml_meth;
26033  Py_ssize_t size;
26034  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26035  case METH_VARARGS:
26036  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26037  return (*meth)(self, arg);
26038  break;
26039  case METH_VARARGS | METH_KEYWORDS:
26040  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26041  case METH_NOARGS:
26042  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26043  size = PyTuple_GET_SIZE(arg);
26044  if (likely(size == 0))
26045  return (*meth)(self, NULL);
26046  PyErr_Format(PyExc_TypeError,
26047  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26048  f->m_ml->ml_name, size);
26049  return NULL;
26050  }
26051  break;
26052  case METH_O:
26053  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26054  size = PyTuple_GET_SIZE(arg);
26055  if (likely(size == 1)) {
26056  PyObject *result, *arg0;
26057  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26058  arg0 = PyTuple_GET_ITEM(arg, 0);
26059  #else
26060  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26061  #endif
26062  result = (*meth)(self, arg0);
26063  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26064  Py_DECREF(arg0);
26065  #endif
26066  return result;
26067  }
26068  PyErr_Format(PyExc_TypeError,
26069  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26070  f->m_ml->ml_name, size);
26071  return NULL;
26072  }
26073  break;
26074  default:
26075  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26076  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26077  "longer supported!");
26078  return NULL;
26079  }
26080  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26081  f->m_ml->ml_name);
26082  return NULL;
26083 }
26084 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26085  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26086 }
26087 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26088  PyObject *result;
26089  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26090  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26091  Py_ssize_t argc;
26092  PyObject *new_args;
26093  PyObject *self;
26094  argc = PyTuple_GET_SIZE(args);
26095  new_args = PyTuple_GetSlice(args, 1, argc);
26096  if (unlikely(!new_args))
26097  return NULL;
26098  self = PyTuple_GetItem(args, 0);
26099  if (unlikely(!self)) {
26100  Py_DECREF(new_args);
26101  return NULL;
26102  }
26103  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26104  Py_DECREF(new_args);
26105  } else {
26106  result = __Pyx_CyFunction_Call(func, args, kw);
26107  }
26108  return result;
26109 }
26110 static PyTypeObject __pyx_CyFunctionType_type = {
26111  PyVarObject_HEAD_INIT(0, 0)
26112  "cython_function_or_method",
26113  sizeof(__pyx_CyFunctionObject),
26114  0,
26115  (destructor) __Pyx_CyFunction_dealloc,
26116  0,
26117  0,
26118  0,
26119 #if PY_MAJOR_VERSION < 3
26120  0,
26121 #else
26122  0,
26123 #endif
26124  (reprfunc) __Pyx_CyFunction_repr,
26125  0,
26126  0,
26127  0,
26128  0,
26129  __Pyx_CyFunction_CallAsMethod,
26130  0,
26131  0,
26132  0,
26133  0,
26134  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26135  0,
26136  (traverseproc) __Pyx_CyFunction_traverse,
26137  (inquiry) __Pyx_CyFunction_clear,
26138  0,
26139 #if PY_VERSION_HEX < 0x030500A0
26140  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26141 #else
26142  offsetof(PyCFunctionObject, m_weakreflist),
26143 #endif
26144  0,
26145  0,
26146  __pyx_CyFunction_methods,
26147  __pyx_CyFunction_members,
26148  __pyx_CyFunction_getsets,
26149  0,
26150  0,
26151  __Pyx_CyFunction_descr_get,
26152  0,
26153  offsetof(__pyx_CyFunctionObject, func_dict),
26154  0,
26155  0,
26156  0,
26157  0,
26158  0,
26159  0,
26160  0,
26161  0,
26162  0,
26163  0,
26164  0,
26165  0,
26166 #if PY_VERSION_HEX >= 0x030400a1
26167  0,
26168 #endif
26169 #if PY_VERSION_HEX >= 0x030800b1
26170  0,
26171 #endif
26172 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26173  0,
26174 #endif
26175 };
26176 static int __pyx_CyFunction_init(void) {
26177  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26178  if (unlikely(__pyx_CyFunctionType == NULL)) {
26179  return -1;
26180  }
26181  return 0;
26182 }
26183 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26184  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26185  m->defaults = PyObject_Malloc(size);
26186  if (unlikely(!m->defaults))
26187  return PyErr_NoMemory();
26188  memset(m->defaults, 0, size);
26189  m->defaults_pyobjects = pyobjects;
26190  m->defaults_size = size;
26191  return m->defaults;
26192 }
26193 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26194  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26195  m->defaults_tuple = tuple;
26196  Py_INCREF(tuple);
26197 }
26198 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26199  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26200  m->defaults_kwdict = dict;
26201  Py_INCREF(dict);
26202 }
26203 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26204  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26205  m->func_annotations = dict;
26206  Py_INCREF(dict);
26207 }
26208 
26209 /* CythonFunction */
26210 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26211  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26212  PyObject *op = __Pyx_CyFunction_Init(
26213  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26214  ml, flags, qualname, closure, module, globals, code
26215  );
26216  if (likely(op)) {
26217  PyObject_GC_Track(op);
26218  }
26219  return op;
26220 }
26221 
26222 /* PyObjectCall2Args */
26223 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
26224  PyObject *args, *result = NULL;
26225  #if CYTHON_FAST_PYCALL
26226  if (PyFunction_Check(function)) {
26227  PyObject *args[2] = {arg1, arg2};
26228  return __Pyx_PyFunction_FastCall(function, args, 2);
26229  }
26230  #endif
26231  #if CYTHON_FAST_PYCCALL
26232  if (__Pyx_PyFastCFunction_Check(function)) {
26233  PyObject *args[2] = {arg1, arg2};
26234  return __Pyx_PyCFunction_FastCall(function, args, 2);
26235  }
26236  #endif
26237  args = PyTuple_New(2);
26238  if (unlikely(!args)) goto done;
26239  Py_INCREF(arg1);
26240  PyTuple_SET_ITEM(args, 0, arg1);
26241  Py_INCREF(arg2);
26242  PyTuple_SET_ITEM(args, 1, arg2);
26243  Py_INCREF(function);
26244  result = __Pyx_PyObject_Call(function, args, NULL);
26245  Py_DECREF(args);
26246  Py_DECREF(function);
26247 done:
26248  return result;
26249 }
26250 
26251 /* SliceObject */
26252 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
26253  Py_ssize_t cstart, Py_ssize_t cstop,
26254  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
26255  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
26256 #if CYTHON_USE_TYPE_SLOTS
26257  PyMappingMethods* mp;
26258 #if PY_MAJOR_VERSION < 3
26259  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
26260  if (likely(ms && ms->sq_slice)) {
26261  if (!has_cstart) {
26262  if (_py_start && (*_py_start != Py_None)) {
26263  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
26264  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
26265  } else
26266  cstart = 0;
26267  }
26268  if (!has_cstop) {
26269  if (_py_stop && (*_py_stop != Py_None)) {
26270  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
26271  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
26272  } else
26273  cstop = PY_SSIZE_T_MAX;
26274  }
26275  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
26276  Py_ssize_t l = ms->sq_length(obj);
26277  if (likely(l >= 0)) {
26278  if (cstop < 0) {
26279  cstop += l;
26280  if (cstop < 0) cstop = 0;
26281  }
26282  if (cstart < 0) {
26283  cstart += l;
26284  if (cstart < 0) cstart = 0;
26285  }
26286  } else {
26287  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26288  goto bad;
26289  PyErr_Clear();
26290  }
26291  }
26292  return ms->sq_slice(obj, cstart, cstop);
26293  }
26294 #endif
26295  mp = Py_TYPE(obj)->tp_as_mapping;
26296  if (likely(mp && mp->mp_subscript))
26297 #endif
26298  {
26299  PyObject* result;
26300  PyObject *py_slice, *py_start, *py_stop;
26301  if (_py_slice) {
26302  py_slice = *_py_slice;
26303  } else {
26304  PyObject* owned_start = NULL;
26305  PyObject* owned_stop = NULL;
26306  if (_py_start) {
26307  py_start = *_py_start;
26308  } else {
26309  if (has_cstart) {
26310  owned_start = py_start = PyInt_FromSsize_t(cstart);
26311  if (unlikely(!py_start)) goto bad;
26312  } else
26313  py_start = Py_None;
26314  }
26315  if (_py_stop) {
26316  py_stop = *_py_stop;
26317  } else {
26318  if (has_cstop) {
26319  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
26320  if (unlikely(!py_stop)) {
26321  Py_XDECREF(owned_start);
26322  goto bad;
26323  }
26324  } else
26325  py_stop = Py_None;
26326  }
26327  py_slice = PySlice_New(py_start, py_stop, Py_None);
26328  Py_XDECREF(owned_start);
26329  Py_XDECREF(owned_stop);
26330  if (unlikely(!py_slice)) goto bad;
26331  }
26332 #if CYTHON_USE_TYPE_SLOTS
26333  result = mp->mp_subscript(obj, py_slice);
26334 #else
26335  result = PyObject_GetItem(obj, py_slice);
26336 #endif
26337  if (!_py_slice) {
26338  Py_DECREF(py_slice);
26339  }
26340  return result;
26341  }
26342  PyErr_Format(PyExc_TypeError,
26343  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
26344 bad:
26345  return NULL;
26346 }
26347 
26348 /* RaiseException */
26349 #if PY_MAJOR_VERSION < 3
26350 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26351  CYTHON_UNUSED PyObject *cause) {
26352  __Pyx_PyThreadState_declare
26353  Py_XINCREF(type);
26354  if (!value || value == Py_None)
26355  value = NULL;
26356  else
26357  Py_INCREF(value);
26358  if (!tb || tb == Py_None)
26359  tb = NULL;
26360  else {
26361  Py_INCREF(tb);
26362  if (!PyTraceBack_Check(tb)) {
26363  PyErr_SetString(PyExc_TypeError,
26364  "raise: arg 3 must be a traceback or None");
26365  goto raise_error;
26366  }
26367  }
26368  if (PyType_Check(type)) {
26369 #if CYTHON_COMPILING_IN_PYPY
26370  if (!value) {
26371  Py_INCREF(Py_None);
26372  value = Py_None;
26373  }
26374 #endif
26375  PyErr_NormalizeException(&type, &value, &tb);
26376  } else {
26377  if (value) {
26378  PyErr_SetString(PyExc_TypeError,
26379  "instance exception may not have a separate value");
26380  goto raise_error;
26381  }
26382  value = type;
26383  type = (PyObject*) Py_TYPE(type);
26384  Py_INCREF(type);
26385  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26386  PyErr_SetString(PyExc_TypeError,
26387  "raise: exception class must be a subclass of BaseException");
26388  goto raise_error;
26389  }
26390  }
26391  __Pyx_PyThreadState_assign
26392  __Pyx_ErrRestore(type, value, tb);
26393  return;
26394 raise_error:
26395  Py_XDECREF(value);
26396  Py_XDECREF(type);
26397  Py_XDECREF(tb);
26398  return;
26399 }
26400 #else
26401 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26402  PyObject* owned_instance = NULL;
26403  if (tb == Py_None) {
26404  tb = 0;
26405  } else if (tb && !PyTraceBack_Check(tb)) {
26406  PyErr_SetString(PyExc_TypeError,
26407  "raise: arg 3 must be a traceback or None");
26408  goto bad;
26409  }
26410  if (value == Py_None)
26411  value = 0;
26412  if (PyExceptionInstance_Check(type)) {
26413  if (value) {
26414  PyErr_SetString(PyExc_TypeError,
26415  "instance exception may not have a separate value");
26416  goto bad;
26417  }
26418  value = type;
26419  type = (PyObject*) Py_TYPE(value);
26420  } else if (PyExceptionClass_Check(type)) {
26421  PyObject *instance_class = NULL;
26422  if (value && PyExceptionInstance_Check(value)) {
26423  instance_class = (PyObject*) Py_TYPE(value);
26424  if (instance_class != type) {
26425  int is_subclass = PyObject_IsSubclass(instance_class, type);
26426  if (!is_subclass) {
26427  instance_class = NULL;
26428  } else if (unlikely(is_subclass == -1)) {
26429  goto bad;
26430  } else {
26431  type = instance_class;
26432  }
26433  }
26434  }
26435  if (!instance_class) {
26436  PyObject *args;
26437  if (!value)
26438  args = PyTuple_New(0);
26439  else if (PyTuple_Check(value)) {
26440  Py_INCREF(value);
26441  args = value;
26442  } else
26443  args = PyTuple_Pack(1, value);
26444  if (!args)
26445  goto bad;
26446  owned_instance = PyObject_Call(type, args, NULL);
26447  Py_DECREF(args);
26448  if (!owned_instance)
26449  goto bad;
26450  value = owned_instance;
26451  if (!PyExceptionInstance_Check(value)) {
26452  PyErr_Format(PyExc_TypeError,
26453  "calling %R should have returned an instance of "
26454  "BaseException, not %R",
26455  type, Py_TYPE(value));
26456  goto bad;
26457  }
26458  }
26459  } else {
26460  PyErr_SetString(PyExc_TypeError,
26461  "raise: exception class must be a subclass of BaseException");
26462  goto bad;
26463  }
26464  if (cause) {
26465  PyObject *fixed_cause;
26466  if (cause == Py_None) {
26467  fixed_cause = NULL;
26468  } else if (PyExceptionClass_Check(cause)) {
26469  fixed_cause = PyObject_CallObject(cause, NULL);
26470  if (fixed_cause == NULL)
26471  goto bad;
26472  } else if (PyExceptionInstance_Check(cause)) {
26473  fixed_cause = cause;
26474  Py_INCREF(fixed_cause);
26475  } else {
26476  PyErr_SetString(PyExc_TypeError,
26477  "exception causes must derive from "
26478  "BaseException");
26479  goto bad;
26480  }
26481  PyException_SetCause(value, fixed_cause);
26482  }
26483  PyErr_SetObject(type, value);
26484  if (tb) {
26485 #if CYTHON_COMPILING_IN_PYPY
26486  PyObject *tmp_type, *tmp_value, *tmp_tb;
26487  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26488  Py_INCREF(tb);
26489  PyErr_Restore(tmp_type, tmp_value, tb);
26490  Py_XDECREF(tmp_tb);
26491 #else
26492  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26493  PyObject* tmp_tb = tstate->curexc_traceback;
26494  if (tb != tmp_tb) {
26495  Py_INCREF(tb);
26496  tstate->curexc_traceback = tb;
26497  Py_XDECREF(tmp_tb);
26498  }
26499 #endif
26500  }
26501 bad:
26502  Py_XDECREF(owned_instance);
26503  return;
26504 }
26505 #endif
26506 
26507 /* HasAttr */
26508 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
26509  PyObject *r;
26510  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26511  PyErr_SetString(PyExc_TypeError,
26512  "hasattr(): attribute name must be string");
26513  return -1;
26514  }
26515  r = __Pyx_GetAttr(o, n);
26516  if (unlikely(!r)) {
26517  PyErr_Clear();
26518  return 0;
26519  } else {
26520  Py_DECREF(r);
26521  return 1;
26522  }
26523 }
26524 
26525 /* DictGetItem */
26526 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
26527 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
26528  PyObject *value;
26529  value = PyDict_GetItemWithError(d, key);
26530  if (unlikely(!value)) {
26531  if (!PyErr_Occurred()) {
26532  if (unlikely(PyTuple_Check(key))) {
26533  PyObject* args = PyTuple_Pack(1, key);
26534  if (likely(args)) {
26535  PyErr_SetObject(PyExc_KeyError, args);
26536  Py_DECREF(args);
26537  }
26538  } else {
26539  PyErr_SetObject(PyExc_KeyError, key);
26540  }
26541  }
26542  return NULL;
26543  }
26544  Py_INCREF(value);
26545  return value;
26546 }
26547 #endif
26548 
26549 /* RaiseTooManyValuesToUnpack */
26550 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26551  PyErr_Format(PyExc_ValueError,
26552  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
26553 }
26554 
26555 /* RaiseNeedMoreValuesToUnpack */
26556 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26557  PyErr_Format(PyExc_ValueError,
26558  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
26559  index, (index == 1) ? "" : "s");
26560 }
26561 
26562 /* RaiseNoneIterError */
26563 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
26564  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
26565 }
26566 
26567 /* ExtTypeTest */
26568 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26569  if (unlikely(!type)) {
26570  PyErr_SetString(PyExc_SystemError, "Missing type object");
26571  return 0;
26572  }
26573  if (likely(__Pyx_TypeCheck(obj, type)))
26574  return 1;
26575  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
26576  Py_TYPE(obj)->tp_name, type->tp_name);
26577  return 0;
26578 }
26579 
26580 /* GetTopmostException */
26581 #if CYTHON_USE_EXC_INFO_STACK
26582 static _PyErr_StackItem *
26583 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26584 {
26585  _PyErr_StackItem *exc_info = tstate->exc_info;
26586  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26587  exc_info->previous_item != NULL)
26588  {
26589  exc_info = exc_info->previous_item;
26590  }
26591  return exc_info;
26592 }
26593 #endif
26594 
26595 /* SaveResetException */
26596 #if CYTHON_FAST_THREAD_STATE
26597 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26598  #if CYTHON_USE_EXC_INFO_STACK
26599  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26600  *type = exc_info->exc_type;
26601  *value = exc_info->exc_value;
26602  *tb = exc_info->exc_traceback;
26603  #else
26604  *type = tstate->exc_type;
26605  *value = tstate->exc_value;
26606  *tb = tstate->exc_traceback;
26607  #endif
26608  Py_XINCREF(*type);
26609  Py_XINCREF(*value);
26610  Py_XINCREF(*tb);
26611 }
26612 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26613  PyObject *tmp_type, *tmp_value, *tmp_tb;
26614  #if CYTHON_USE_EXC_INFO_STACK
26615  _PyErr_StackItem *exc_info = tstate->exc_info;
26616  tmp_type = exc_info->exc_type;
26617  tmp_value = exc_info->exc_value;
26618  tmp_tb = exc_info->exc_traceback;
26619  exc_info->exc_type = type;
26620  exc_info->exc_value = value;
26621  exc_info->exc_traceback = tb;
26622  #else
26623  tmp_type = tstate->exc_type;
26624  tmp_value = tstate->exc_value;
26625  tmp_tb = tstate->exc_traceback;
26626  tstate->exc_type = type;
26627  tstate->exc_value = value;
26628  tstate->exc_traceback = tb;
26629  #endif
26630  Py_XDECREF(tmp_type);
26631  Py_XDECREF(tmp_value);
26632  Py_XDECREF(tmp_tb);
26633 }
26634 #endif
26635 
26636 /* GetException */
26637 #if CYTHON_FAST_THREAD_STATE
26638 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26639 #else
26640 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26641 #endif
26642 {
26643  PyObject *local_type, *local_value, *local_tb;
26644 #if CYTHON_FAST_THREAD_STATE
26645  PyObject *tmp_type, *tmp_value, *tmp_tb;
26646  local_type = tstate->curexc_type;
26647  local_value = tstate->curexc_value;
26648  local_tb = tstate->curexc_traceback;
26649  tstate->curexc_type = 0;
26650  tstate->curexc_value = 0;
26651  tstate->curexc_traceback = 0;
26652 #else
26653  PyErr_Fetch(&local_type, &local_value, &local_tb);
26654 #endif
26655  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26656 #if CYTHON_FAST_THREAD_STATE
26657  if (unlikely(tstate->curexc_type))
26658 #else
26659  if (unlikely(PyErr_Occurred()))
26660 #endif
26661  goto bad;
26662  #if PY_MAJOR_VERSION >= 3
26663  if (local_tb) {
26664  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26665  goto bad;
26666  }
26667  #endif
26668  Py_XINCREF(local_tb);
26669  Py_XINCREF(local_type);
26670  Py_XINCREF(local_value);
26671  *type = local_type;
26672  *value = local_value;
26673  *tb = local_tb;
26674 #if CYTHON_FAST_THREAD_STATE
26675  #if CYTHON_USE_EXC_INFO_STACK
26676  {
26677  _PyErr_StackItem *exc_info = tstate->exc_info;
26678  tmp_type = exc_info->exc_type;
26679  tmp_value = exc_info->exc_value;
26680  tmp_tb = exc_info->exc_traceback;
26681  exc_info->exc_type = local_type;
26682  exc_info->exc_value = local_value;
26683  exc_info->exc_traceback = local_tb;
26684  }
26685  #else
26686  tmp_type = tstate->exc_type;
26687  tmp_value = tstate->exc_value;
26688  tmp_tb = tstate->exc_traceback;
26689  tstate->exc_type = local_type;
26690  tstate->exc_value = local_value;
26691  tstate->exc_traceback = local_tb;
26692  #endif
26693  Py_XDECREF(tmp_type);
26694  Py_XDECREF(tmp_value);
26695  Py_XDECREF(tmp_tb);
26696 #else
26697  PyErr_SetExcInfo(local_type, local_value, local_tb);
26698 #endif
26699  return 0;
26700 bad:
26701  *type = 0;
26702  *value = 0;
26703  *tb = 0;
26704  Py_XDECREF(local_type);
26705  Py_XDECREF(local_value);
26706  Py_XDECREF(local_tb);
26707  return -1;
26708 }
26709 
26710 /* ArgTypeTest */
26711 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26712 {
26713  if (unlikely(!type)) {
26714  PyErr_SetString(PyExc_SystemError, "Missing type object");
26715  return 0;
26716  }
26717  else if (exact) {
26718  #if PY_MAJOR_VERSION == 2
26719  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
26720  #endif
26721  }
26722  else {
26723  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
26724  }
26725  PyErr_Format(PyExc_TypeError,
26726  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26727  name, type->tp_name, Py_TYPE(obj)->tp_name);
26728  return 0;
26729 }
26730 
26731 /* BytesEquals */
26732 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
26733 #if CYTHON_COMPILING_IN_PYPY
26734  return PyObject_RichCompareBool(s1, s2, equals);
26735 #else
26736  if (s1 == s2) {
26737  return (equals == Py_EQ);
26738  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26739  const char *ps1, *ps2;
26740  Py_ssize_t length = PyBytes_GET_SIZE(s1);
26741  if (length != PyBytes_GET_SIZE(s2))
26742  return (equals == Py_NE);
26743  ps1 = PyBytes_AS_STRING(s1);
26744  ps2 = PyBytes_AS_STRING(s2);
26745  if (ps1[0] != ps2[0]) {
26746  return (equals == Py_NE);
26747  } else if (length == 1) {
26748  return (equals == Py_EQ);
26749  } else {
26750  int result;
26751 #if CYTHON_USE_UNICODE_INTERNALS
26752  Py_hash_t hash1, hash2;
26753  hash1 = ((PyBytesObject*)s1)->ob_shash;
26754  hash2 = ((PyBytesObject*)s2)->ob_shash;
26755  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26756  return (equals == Py_NE);
26757  }
26758 #endif
26759  result = memcmp(ps1, ps2, (size_t)length);
26760  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26761  }
26762  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26763  return (equals == Py_NE);
26764  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26765  return (equals == Py_NE);
26766  } else {
26767  int result;
26768  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26769  if (!py_result)
26770  return -1;
26771  result = __Pyx_PyObject_IsTrue(py_result);
26772  Py_DECREF(py_result);
26773  return result;
26774  }
26775 #endif
26776 }
26777 
26778 /* UnicodeEquals */
26779 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
26780 #if CYTHON_COMPILING_IN_PYPY
26781  return PyObject_RichCompareBool(s1, s2, equals);
26782 #else
26783 #if PY_MAJOR_VERSION < 3
26784  PyObject* owned_ref = NULL;
26785 #endif
26786  int s1_is_unicode, s2_is_unicode;
26787  if (s1 == s2) {
26788  goto return_eq;
26789  }
26790  s1_is_unicode = PyUnicode_CheckExact(s1);
26791  s2_is_unicode = PyUnicode_CheckExact(s2);
26792 #if PY_MAJOR_VERSION < 3
26793  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26794  owned_ref = PyUnicode_FromObject(s2);
26795  if (unlikely(!owned_ref))
26796  return -1;
26797  s2 = owned_ref;
26798  s2_is_unicode = 1;
26799  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26800  owned_ref = PyUnicode_FromObject(s1);
26801  if (unlikely(!owned_ref))
26802  return -1;
26803  s1 = owned_ref;
26804  s1_is_unicode = 1;
26805  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26806  return __Pyx_PyBytes_Equals(s1, s2, equals);
26807  }
26808 #endif
26809  if (s1_is_unicode & s2_is_unicode) {
26810  Py_ssize_t length;
26811  int kind;
26812  void *data1, *data2;
26813  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26814  return -1;
26815  length = __Pyx_PyUnicode_GET_LENGTH(s1);
26816  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26817  goto return_ne;
26818  }
26819 #if CYTHON_USE_UNICODE_INTERNALS
26820  {
26821  Py_hash_t hash1, hash2;
26822  #if CYTHON_PEP393_ENABLED
26823  hash1 = ((PyASCIIObject*)s1)->hash;
26824  hash2 = ((PyASCIIObject*)s2)->hash;
26825  #else
26826  hash1 = ((PyUnicodeObject*)s1)->hash;
26827  hash2 = ((PyUnicodeObject*)s2)->hash;
26828  #endif
26829  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26830  goto return_ne;
26831  }
26832  }
26833 #endif
26834  kind = __Pyx_PyUnicode_KIND(s1);
26835  if (kind != __Pyx_PyUnicode_KIND(s2)) {
26836  goto return_ne;
26837  }
26838  data1 = __Pyx_PyUnicode_DATA(s1);
26839  data2 = __Pyx_PyUnicode_DATA(s2);
26840  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26841  goto return_ne;
26842  } else if (length == 1) {
26843  goto return_eq;
26844  } else {
26845  int result = memcmp(data1, data2, (size_t)(length * kind));
26846  #if PY_MAJOR_VERSION < 3
26847  Py_XDECREF(owned_ref);
26848  #endif
26849  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26850  }
26851  } else if ((s1 == Py_None) & s2_is_unicode) {
26852  goto return_ne;
26853  } else if ((s2 == Py_None) & s1_is_unicode) {
26854  goto return_ne;
26855  } else {
26856  int result;
26857  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26858  #if PY_MAJOR_VERSION < 3
26859  Py_XDECREF(owned_ref);
26860  #endif
26861  if (!py_result)
26862  return -1;
26863  result = __Pyx_PyObject_IsTrue(py_result);
26864  Py_DECREF(py_result);
26865  return result;
26866  }
26867 return_eq:
26868  #if PY_MAJOR_VERSION < 3
26869  Py_XDECREF(owned_ref);
26870  #endif
26871  return (equals == Py_EQ);
26872 return_ne:
26873  #if PY_MAJOR_VERSION < 3
26874  Py_XDECREF(owned_ref);
26875  #endif
26876  return (equals == Py_NE);
26877 #endif
26878 }
26879 
26880 /* None */
26881 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26882  Py_ssize_t q = a / b;
26883  Py_ssize_t r = a - q*b;
26884  q -= ((r != 0) & ((r ^ b) < 0));
26885  return q;
26886 }
26887 
26888 /* decode_c_string */
26889 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26890  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26891  const char* encoding, const char* errors,
26892  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
26893  Py_ssize_t length;
26894  if (unlikely((start < 0) | (stop < 0))) {
26895  size_t slen = strlen(cstring);
26896  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
26897  PyErr_SetString(PyExc_OverflowError,
26898  "c-string too long to convert to Python");
26899  return NULL;
26900  }
26901  length = (Py_ssize_t) slen;
26902  if (start < 0) {
26903  start += length;
26904  if (start < 0)
26905  start = 0;
26906  }
26907  if (stop < 0)
26908  stop += length;
26909  }
26910  if (unlikely(stop <= start))
26911  return __Pyx_NewRef(__pyx_empty_unicode);
26912  length = stop - start;
26913  cstring += start;
26914  if (decode_func) {
26915  return decode_func(cstring, length, errors);
26916  } else {
26917  return PyUnicode_Decode(cstring, length, encoding, errors);
26918  }
26919 }
26920 
26921 /* SwapException */
26922 #if CYTHON_FAST_THREAD_STATE
26923 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26924  PyObject *tmp_type, *tmp_value, *tmp_tb;
26925  #if CYTHON_USE_EXC_INFO_STACK
26926  _PyErr_StackItem *exc_info = tstate->exc_info;
26927  tmp_type = exc_info->exc_type;
26928  tmp_value = exc_info->exc_value;
26929  tmp_tb = exc_info->exc_traceback;
26930  exc_info->exc_type = *type;
26931  exc_info->exc_value = *value;
26932  exc_info->exc_traceback = *tb;
26933  #else
26934  tmp_type = tstate->exc_type;
26935  tmp_value = tstate->exc_value;
26936  tmp_tb = tstate->exc_traceback;
26937  tstate->exc_type = *type;
26938  tstate->exc_value = *value;
26939  tstate->exc_traceback = *tb;
26940  #endif
26941  *type = tmp_type;
26942  *value = tmp_value;
26943  *tb = tmp_tb;
26944 }
26945 #else
26946 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26947  PyObject *tmp_type, *tmp_value, *tmp_tb;
26948  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26949  PyErr_SetExcInfo(*type, *value, *tb);
26950  *type = tmp_type;
26951  *value = tmp_value;
26952  *tb = tmp_tb;
26953 }
26954 #endif
26955 
26956 /* FastTypeChecks */
26957 #if CYTHON_COMPILING_IN_CPYTHON
26958 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26959  while (a) {
26960  a = a->tp_base;
26961  if (a == b)
26962  return 1;
26963  }
26964  return b == &PyBaseObject_Type;
26965 }
26966 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26967  PyObject *mro;
26968  if (a == b) return 1;
26969  mro = a->tp_mro;
26970  if (likely(mro)) {
26971  Py_ssize_t i, n;
26972  n = PyTuple_GET_SIZE(mro);
26973  for (i = 0; i < n; i++) {
26974  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26975  return 1;
26976  }
26977  return 0;
26978  }
26979  return __Pyx_InBases(a, b);
26980 }
26981 #if PY_MAJOR_VERSION == 2
26982 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26983  PyObject *exception, *value, *tb;
26984  int res;
26985  __Pyx_PyThreadState_declare
26986  __Pyx_PyThreadState_assign
26987  __Pyx_ErrFetch(&exception, &value, &tb);
26988  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26989  if (unlikely(res == -1)) {
26990  PyErr_WriteUnraisable(err);
26991  res = 0;
26992  }
26993  if (!res) {
26994  res = PyObject_IsSubclass(err, exc_type2);
26995  if (unlikely(res == -1)) {
26996  PyErr_WriteUnraisable(err);
26997  res = 0;
26998  }
26999  }
27000  __Pyx_ErrRestore(exception, value, tb);
27001  return res;
27002 }
27003 #else
27004 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27005  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
27006  if (!res) {
27007  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27008  }
27009  return res;
27010 }
27011 #endif
27012 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27013  Py_ssize_t i, n;
27014  assert(PyExceptionClass_Check(exc_type));
27015  n = PyTuple_GET_SIZE(tuple);
27016 #if PY_MAJOR_VERSION >= 3
27017  for (i=0; i<n; i++) {
27018  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27019  }
27020 #endif
27021  for (i=0; i<n; i++) {
27022  PyObject *t = PyTuple_GET_ITEM(tuple, i);
27023  #if PY_MAJOR_VERSION < 3
27024  if (likely(exc_type == t)) return 1;
27025  #endif
27026  if (likely(PyExceptionClass_Check(t))) {
27027  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
27028  } else {
27029  }
27030  }
27031  return 0;
27032 }
27033 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27034  if (likely(err == exc_type)) return 1;
27035  if (likely(PyExceptionClass_Check(err))) {
27036  if (likely(PyExceptionClass_Check(exc_type))) {
27037  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27038  } else if (likely(PyTuple_Check(exc_type))) {
27039  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27040  } else {
27041  }
27042  }
27043  return PyErr_GivenExceptionMatches(err, exc_type);
27044 }
27045 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27046  assert(PyExceptionClass_Check(exc_type1));
27047  assert(PyExceptionClass_Check(exc_type2));
27048  if (likely(err == exc_type1 || err == exc_type2)) return 1;
27049  if (likely(PyExceptionClass_Check(err))) {
27050  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27051  }
27052  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27053 }
27054 #endif
27055 
27056 /* PyIntBinop */
27057 #if !CYTHON_COMPILING_IN_PYPY
27058 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
27059  (void)inplace;
27060  (void)zerodivision_check;
27061  #if PY_MAJOR_VERSION < 3
27062  if (likely(PyInt_CheckExact(op1))) {
27063  const long b = intval;
27064  long x;
27065  long a = PyInt_AS_LONG(op1);
27066  x = (long)((unsigned long)a + b);
27067  if (likely((x^a) >= 0 || (x^b) >= 0))
27068  return PyInt_FromLong(x);
27069  return PyLong_Type.tp_as_number->nb_add(op1, op2);
27070  }
27071  #endif
27072  #if CYTHON_USE_PYLONG_INTERNALS
27073  if (likely(PyLong_CheckExact(op1))) {
27074  const long b = intval;
27075  long a, x;
27076 #ifdef HAVE_LONG_LONG
27077  const PY_LONG_LONG llb = intval;
27078  PY_LONG_LONG lla, llx;
27079 #endif
27080  const digit* digits = ((PyLongObject*)op1)->ob_digit;
27081  const Py_ssize_t size = Py_SIZE(op1);
27082  if (likely(__Pyx_sst_abs(size) <= 1)) {
27083  a = likely(size) ? digits[0] : 0;
27084  if (size == -1) a = -a;
27085  } else {
27086  switch (size) {
27087  case -2:
27088  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27089  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27090  break;
27091 #ifdef HAVE_LONG_LONG
27092  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27093  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27094  goto long_long;
27095 #endif
27096  }
27097  CYTHON_FALLTHROUGH;
27098  case 2:
27099  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27100  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27101  break;
27102 #ifdef HAVE_LONG_LONG
27103  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27104  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27105  goto long_long;
27106 #endif
27107  }
27108  CYTHON_FALLTHROUGH;
27109  case -3:
27110  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27111  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27112  break;
27113 #ifdef HAVE_LONG_LONG
27114  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27115  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27116  goto long_long;
27117 #endif
27118  }
27119  CYTHON_FALLTHROUGH;
27120  case 3:
27121  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27122  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27123  break;
27124 #ifdef HAVE_LONG_LONG
27125  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27126  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27127  goto long_long;
27128 #endif
27129  }
27130  CYTHON_FALLTHROUGH;
27131  case -4:
27132  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27133  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27134  break;
27135 #ifdef HAVE_LONG_LONG
27136  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27137  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27138  goto long_long;
27139 #endif
27140  }
27141  CYTHON_FALLTHROUGH;
27142  case 4:
27143  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27144  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27145  break;
27146 #ifdef HAVE_LONG_LONG
27147  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27148  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27149  goto long_long;
27150 #endif
27151  }
27152  CYTHON_FALLTHROUGH;
27153  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
27154  }
27155  }
27156  x = a + b;
27157  return PyLong_FromLong(x);
27158 #ifdef HAVE_LONG_LONG
27159  long_long:
27160  llx = lla + llb;
27161  return PyLong_FromLongLong(llx);
27162 #endif
27163 
27164 
27165  }
27166  #endif
27167  if (PyFloat_CheckExact(op1)) {
27168  const long b = intval;
27169  double a = PyFloat_AS_DOUBLE(op1);
27170  double result;
27171  PyFPE_START_PROTECT("add", return NULL)
27172  result = ((double)a) + (double)b;
27173  PyFPE_END_PROTECT(result)
27174  return PyFloat_FromDouble(result);
27175  }
27176  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
27177 }
27178 #endif
27179 
27180 /* None */
27181 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
27182  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
27183 }
27184 
27185 /* None */
27186 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
27187  long q = a / b;
27188  long r = a - q*b;
27189  q -= ((r != 0) & ((r ^ b) < 0));
27190  return q;
27191 }
27192 
27193 /* PyObject_GenericGetAttrNoDict */
27194 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27195 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
27196  PyErr_Format(PyExc_AttributeError,
27197 #if PY_MAJOR_VERSION >= 3
27198  "'%.50s' object has no attribute '%U'",
27199  tp->tp_name, attr_name);
27200 #else
27201  "'%.50s' object has no attribute '%.400s'",
27202  tp->tp_name, PyString_AS_STRING(attr_name));
27203 #endif
27204  return NULL;
27205 }
27206 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
27207  PyObject *descr;
27208  PyTypeObject *tp = Py_TYPE(obj);
27209  if (unlikely(!PyString_Check(attr_name))) {
27210  return PyObject_GenericGetAttr(obj, attr_name);
27211  }
27212  assert(!tp->tp_dictoffset);
27213  descr = _PyType_Lookup(tp, attr_name);
27214  if (unlikely(!descr)) {
27215  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
27216  }
27217  Py_INCREF(descr);
27218  #if PY_MAJOR_VERSION < 3
27219  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
27220  #endif
27221  {
27222  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
27223  if (unlikely(f)) {
27224  PyObject *res = f(descr, obj, (PyObject *)tp);
27225  Py_DECREF(descr);
27226  return res;
27227  }
27228  }
27229  return descr;
27230 }
27231 #endif
27232 
27233 /* PyObject_GenericGetAttr */
27234 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27235 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
27236  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
27237  return PyObject_GenericGetAttr(obj, attr_name);
27238  }
27239  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
27240 }
27241 #endif
27242 
27243 /* PyObjectGetAttrStrNoError */
27244 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
27245  __Pyx_PyThreadState_declare
27246  __Pyx_PyThreadState_assign
27247  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27248  __Pyx_PyErr_Clear();
27249 }
27250 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
27251  PyObject *result;
27252 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
27253  PyTypeObject* tp = Py_TYPE(obj);
27254  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
27255  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
27256  }
27257 #endif
27258  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
27259  if (unlikely(!result)) {
27260  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
27261  }
27262  return result;
27263 }
27264 
27265 /* SetupReduce */
27266 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
27267  int ret;
27268  PyObject *name_attr;
27269  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
27270  if (likely(name_attr)) {
27271  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
27272  } else {
27273  ret = -1;
27274  }
27275  if (unlikely(ret < 0)) {
27276  PyErr_Clear();
27277  ret = 0;
27278  }
27279  Py_XDECREF(name_attr);
27280  return ret;
27281 }
27282 static int __Pyx_setup_reduce(PyObject* type_obj) {
27283  int ret = 0;
27284  PyObject *object_reduce = NULL;
27285  PyObject *object_reduce_ex = NULL;
27286  PyObject *reduce = NULL;
27287  PyObject *reduce_ex = NULL;
27288  PyObject *reduce_cython = NULL;
27289  PyObject *setstate = NULL;
27290  PyObject *setstate_cython = NULL;
27291 #if CYTHON_USE_PYTYPE_LOOKUP
27292  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
27293 #else
27294  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
27295 #endif
27296 #if CYTHON_USE_PYTYPE_LOOKUP
27297  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
27298 #else
27299  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
27300 #endif
27301  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
27302  if (reduce_ex == object_reduce_ex) {
27303 #if CYTHON_USE_PYTYPE_LOOKUP
27304  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
27305 #else
27306  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
27307 #endif
27308  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
27309  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
27310  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
27311  if (likely(reduce_cython)) {
27312  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
27313  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
27314  } else if (reduce == object_reduce || PyErr_Occurred()) {
27315  goto __PYX_BAD;
27316  }
27317  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
27318  if (!setstate) PyErr_Clear();
27319  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
27320  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
27321  if (likely(setstate_cython)) {
27322  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
27323  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
27324  } else if (!setstate || PyErr_Occurred()) {
27325  goto __PYX_BAD;
27326  }
27327  }
27328  PyType_Modified((PyTypeObject*)type_obj);
27329  }
27330  }
27331  goto __PYX_GOOD;
27332 __PYX_BAD:
27333  if (!PyErr_Occurred())
27334  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
27335  ret = -1;
27336 __PYX_GOOD:
27337 #if !CYTHON_USE_PYTYPE_LOOKUP
27338  Py_XDECREF(object_reduce);
27339  Py_XDECREF(object_reduce_ex);
27340 #endif
27341  Py_XDECREF(reduce);
27342  Py_XDECREF(reduce_ex);
27343  Py_XDECREF(reduce_cython);
27344  Py_XDECREF(setstate);
27345  Py_XDECREF(setstate_cython);
27346  return ret;
27347 }
27348 
27349 /* SetVTable */
27350 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
27351 #if PY_VERSION_HEX >= 0x02070000
27352  PyObject *ob = PyCapsule_New(vtable, 0, 0);
27353 #else
27354  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
27355 #endif
27356  if (!ob)
27357  goto bad;
27358  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
27359  goto bad;
27360  Py_DECREF(ob);
27361  return 0;
27362 bad:
27363  Py_XDECREF(ob);
27364  return -1;
27365 }
27366 
27367 /* TypeImport */
27368 #ifndef __PYX_HAVE_RT_ImportType
27369 #define __PYX_HAVE_RT_ImportType
27370 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
27371  size_t size, enum __Pyx_ImportType_CheckSize check_size)
27372 {
27373  PyObject *result = 0;
27374  char warning[200];
27375  Py_ssize_t basicsize;
27376 #ifdef Py_LIMITED_API
27377  PyObject *py_basicsize;
27378 #endif
27379  result = PyObject_GetAttrString(module, class_name);
27380  if (!result)
27381  goto bad;
27382  if (!PyType_Check(result)) {
27383  PyErr_Format(PyExc_TypeError,
27384  "%.200s.%.200s is not a type object",
27385  module_name, class_name);
27386  goto bad;
27387  }
27388 #ifndef Py_LIMITED_API
27389  basicsize = ((PyTypeObject *)result)->tp_basicsize;
27390 #else
27391  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
27392  if (!py_basicsize)
27393  goto bad;
27394  basicsize = PyLong_AsSsize_t(py_basicsize);
27395  Py_DECREF(py_basicsize);
27396  py_basicsize = 0;
27397  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27398  goto bad;
27399 #endif
27400  if ((size_t)basicsize < size) {
27401  PyErr_Format(PyExc_ValueError,
27402  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27403  "Expected %zd from C header, got %zd from PyObject",
27404  module_name, class_name, size, basicsize);
27405  goto bad;
27406  }
27407  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
27408  PyErr_Format(PyExc_ValueError,
27409  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27410  "Expected %zd from C header, got %zd from PyObject",
27411  module_name, class_name, size, basicsize);
27412  goto bad;
27413  }
27414  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
27415  PyOS_snprintf(warning, sizeof(warning),
27416  "%s.%s size changed, may indicate binary incompatibility. "
27417  "Expected %zd from C header, got %zd from PyObject",
27418  module_name, class_name, size, basicsize);
27419  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
27420  }
27421  return (PyTypeObject *)result;
27422 bad:
27423  Py_XDECREF(result);
27424  return NULL;
27425 }
27426 #endif
27427 
27428 /* CLineInTraceback */
27429 #ifndef CYTHON_CLINE_IN_TRACEBACK
27430 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
27431  PyObject *use_cline;
27432  PyObject *ptype, *pvalue, *ptraceback;
27433 #if CYTHON_COMPILING_IN_CPYTHON
27434  PyObject **cython_runtime_dict;
27435 #endif
27436  if (unlikely(!__pyx_cython_runtime)) {
27437  return c_line;
27438  }
27439  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27440 #if CYTHON_COMPILING_IN_CPYTHON
27441  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27442  if (likely(cython_runtime_dict)) {
27443  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27444  use_cline, *cython_runtime_dict,
27445  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27446  } else
27447 #endif
27448  {
27449  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27450  if (use_cline_obj) {
27451  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27452  Py_DECREF(use_cline_obj);
27453  } else {
27454  PyErr_Clear();
27455  use_cline = NULL;
27456  }
27457  }
27458  if (!use_cline) {
27459  c_line = 0;
27460  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27461  }
27462  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27463  c_line = 0;
27464  }
27465  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27466  return c_line;
27467 }
27468 #endif
27469 
27470 /* CodeObjectCache */
27471 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
27472  int start = 0, mid = 0, end = count - 1;
27473  if (end >= 0 && code_line > entries[end].code_line) {
27474  return count;
27475  }
27476  while (start < end) {
27477  mid = start + (end - start) / 2;
27478  if (code_line < entries[mid].code_line) {
27479  end = mid;
27480  } else if (code_line > entries[mid].code_line) {
27481  start = mid + 1;
27482  } else {
27483  return mid;
27484  }
27485  }
27486  if (code_line <= entries[mid].code_line) {
27487  return mid;
27488  } else {
27489  return mid + 1;
27490  }
27491 }
27492 static PyCodeObject *__pyx_find_code_object(int code_line) {
27493  PyCodeObject* code_object;
27494  int pos;
27495  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27496  return NULL;
27497  }
27498  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27499  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27500  return NULL;
27501  }
27502  code_object = __pyx_code_cache.entries[pos].code_object;
27503  Py_INCREF(code_object);
27504  return code_object;
27505 }
27506 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
27507  int pos, i;
27508  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27509  if (unlikely(!code_line)) {
27510  return;
27511  }
27512  if (unlikely(!entries)) {
27513  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
27514  if (likely(entries)) {
27515  __pyx_code_cache.entries = entries;
27516  __pyx_code_cache.max_count = 64;
27517  __pyx_code_cache.count = 1;
27518  entries[0].code_line = code_line;
27519  entries[0].code_object = code_object;
27520  Py_INCREF(code_object);
27521  }
27522  return;
27523  }
27524  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27525  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27526  PyCodeObject* tmp = entries[pos].code_object;
27527  entries[pos].code_object = code_object;
27528  Py_DECREF(tmp);
27529  return;
27530  }
27531  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27532  int new_max = __pyx_code_cache.max_count + 64;
27533  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27534  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
27535  if (unlikely(!entries)) {
27536  return;
27537  }
27538  __pyx_code_cache.entries = entries;
27539  __pyx_code_cache.max_count = new_max;
27540  }
27541  for (i=__pyx_code_cache.count; i>pos; i--) {
27542  entries[i] = entries[i-1];
27543  }
27544  entries[pos].code_line = code_line;
27545  entries[pos].code_object = code_object;
27546  __pyx_code_cache.count++;
27547  Py_INCREF(code_object);
27548 }
27549 
27550 /* AddTraceback */
27551 #include "compile.h"
27552 #include "frameobject.h"
27553 #include "traceback.h"
27554 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27555  const char *funcname, int c_line,
27556  int py_line, const char *filename) {
27557  PyCodeObject *py_code = 0;
27558  PyObject *py_srcfile = 0;
27559  PyObject *py_funcname = 0;
27560  #if PY_MAJOR_VERSION < 3
27561  py_srcfile = PyString_FromString(filename);
27562  #else
27563  py_srcfile = PyUnicode_FromString(filename);
27564  #endif
27565  if (!py_srcfile) goto bad;
27566  if (c_line) {
27567  #if PY_MAJOR_VERSION < 3
27568  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27569  #else
27570  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27571  #endif
27572  }
27573  else {
27574  #if PY_MAJOR_VERSION < 3
27575  py_funcname = PyString_FromString(funcname);
27576  #else
27577  py_funcname = PyUnicode_FromString(funcname);
27578  #endif
27579  }
27580  if (!py_funcname) goto bad;
27581  py_code = __Pyx_PyCode_New(
27582  0,
27583  0,
27584  0,
27585  0,
27586  0,
27587  __pyx_empty_bytes, /*PyObject *code,*/
27588  __pyx_empty_tuple, /*PyObject *consts,*/
27589  __pyx_empty_tuple, /*PyObject *names,*/
27590  __pyx_empty_tuple, /*PyObject *varnames,*/
27591  __pyx_empty_tuple, /*PyObject *freevars,*/
27592  __pyx_empty_tuple, /*PyObject *cellvars,*/
27593  py_srcfile, /*PyObject *filename,*/
27594  py_funcname, /*PyObject *name,*/
27595  py_line,
27596  __pyx_empty_bytes /*PyObject *lnotab*/
27597  );
27598  Py_DECREF(py_srcfile);
27599  Py_DECREF(py_funcname);
27600  return py_code;
27601 bad:
27602  Py_XDECREF(py_srcfile);
27603  Py_XDECREF(py_funcname);
27604  return NULL;
27605 }
27606 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27607  int py_line, const char *filename) {
27608  PyCodeObject *py_code = 0;
27609  PyFrameObject *py_frame = 0;
27610  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27611  if (c_line) {
27612  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27613  }
27614  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27615  if (!py_code) {
27616  py_code = __Pyx_CreateCodeObjectForTraceback(
27617  funcname, c_line, py_line, filename);
27618  if (!py_code) goto bad;
27619  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27620  }
27621  py_frame = PyFrame_New(
27622  tstate, /*PyThreadState *tstate,*/
27623  py_code, /*PyCodeObject *code,*/
27624  __pyx_d, /*PyObject *globals,*/
27625  0 /*PyObject *locals*/
27626  );
27627  if (!py_frame) goto bad;
27628  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27629  PyTraceBack_Here(py_frame);
27630 bad:
27631  Py_XDECREF(py_code);
27632  Py_XDECREF(py_frame);
27633 }
27634 
27635 #if PY_MAJOR_VERSION < 3
27636 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27637  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27638  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27639  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27640  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27641  return -1;
27642 }
27643 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27644  PyObject *obj = view->obj;
27645  if (!obj) return;
27646  if (PyObject_CheckBuffer(obj)) {
27647  PyBuffer_Release(view);
27648  return;
27649  }
27650  if ((0)) {}
27651  view->obj = NULL;
27652  Py_DECREF(obj);
27653 }
27654 #endif
27655 
27656 
27657 /* MemviewSliceIsContig */
27658 static int
27659 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27660 {
27661  int i, index, step, start;
27662  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27663  if (order == 'F') {
27664  step = 1;
27665  start = 0;
27666  } else {
27667  step = -1;
27668  start = ndim - 1;
27669  }
27670  for (i = 0; i < ndim; i++) {
27671  index = start + step * i;
27672  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27673  return 0;
27674  itemsize *= mvs.shape[index];
27675  }
27676  return 1;
27677 }
27678 
27679 /* OverlappingSlices */
27680 static void
27681 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27682  void **out_start, void **out_end,
27683  int ndim, size_t itemsize)
27684 {
27685  char *start, *end;
27686  int i;
27687  start = end = slice->data;
27688  for (i = 0; i < ndim; i++) {
27689  Py_ssize_t stride = slice->strides[i];
27690  Py_ssize_t extent = slice->shape[i];
27691  if (extent == 0) {
27692  *out_start = *out_end = start;
27693  return;
27694  } else {
27695  if (stride > 0)
27696  end += stride * (extent - 1);
27697  else
27698  start += stride * (extent - 1);
27699  }
27700  }
27701  *out_start = start;
27702  *out_end = end + itemsize;
27703 }
27704 static int
27705 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27706  __Pyx_memviewslice *slice2,
27707  int ndim, size_t itemsize)
27708 {
27709  void *start1, *end1, *start2, *end2;
27710  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27711  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27712  return (start1 < end2) && (start2 < end1);
27713 }
27714 
27715 /* Capsule */
27716 static CYTHON_INLINE PyObject *
27717 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27718 {
27719  PyObject *cobj;
27720 #if PY_VERSION_HEX >= 0x02070000
27721  cobj = PyCapsule_New(p, sig, NULL);
27722 #else
27723  cobj = PyCObject_FromVoidPtr(p, NULL);
27724 #endif
27725  return cobj;
27726 }
27727 
27728 /* MemviewDtypeToObject */
27729 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
27730  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
27731 }
27732 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
27733  double value = __pyx_PyFloat_AsDouble(obj);
27734  if ((value == (double)-1) && PyErr_Occurred())
27735  return 0;
27736  *(double *) itemp = value;
27737  return 1;
27738 }
27739 
27740 /* IsLittleEndian */
27741 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27742 {
27743  union {
27744  uint32_t u32;
27745  uint8_t u8[4];
27746  } S;
27747  S.u32 = 0x01020304;
27748  return S.u8[0] == 4;
27749 }
27750 
27751 /* BufferFormatCheck */
27752 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27753  __Pyx_BufFmt_StackElem* stack,
27754  __Pyx_TypeInfo* type) {
27755  stack[0].field = &ctx->root;
27756  stack[0].parent_offset = 0;
27757  ctx->root.type = type;
27758  ctx->root.name = "buffer dtype";
27759  ctx->root.offset = 0;
27760  ctx->head = stack;
27761  ctx->head->field = &ctx->root;
27762  ctx->fmt_offset = 0;
27763  ctx->head->parent_offset = 0;
27764  ctx->new_packmode = '@';
27765  ctx->enc_packmode = '@';
27766  ctx->new_count = 1;
27767  ctx->enc_count = 0;
27768  ctx->enc_type = 0;
27769  ctx->is_complex = 0;
27770  ctx->is_valid_array = 0;
27771  ctx->struct_alignment = 0;
27772  while (type->typegroup == 'S') {
27773  ++ctx->head;
27774  ctx->head->field = type->fields;
27775  ctx->head->parent_offset = 0;
27776  type = type->fields->type;
27777  }
27778 }
27779 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27780  int count;
27781  const char* t = *ts;
27782  if (*t < '0' || *t > '9') {
27783  return -1;
27784  } else {
27785  count = *t++ - '0';
27786  while (*t >= '0' && *t <= '9') {
27787  count *= 10;
27788  count += *t++ - '0';
27789  }
27790  }
27791  *ts = t;
27792  return count;
27793 }
27794 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27795  int number = __Pyx_BufFmt_ParseNumber(ts);
27796  if (number == -1)
27797  PyErr_Format(PyExc_ValueError,\
27798  "Does not understand character buffer dtype format string ('%c')", **ts);
27799  return number;
27800 }
27801 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27802  PyErr_Format(PyExc_ValueError,
27803  "Unexpected format string character: '%c'", ch);
27804 }
27805 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27806  switch (ch) {
27807  case '?': return "'bool'";
27808  case 'c': return "'char'";
27809  case 'b': return "'signed char'";
27810  case 'B': return "'unsigned char'";
27811  case 'h': return "'short'";
27812  case 'H': return "'unsigned short'";
27813  case 'i': return "'int'";
27814  case 'I': return "'unsigned int'";
27815  case 'l': return "'long'";
27816  case 'L': return "'unsigned long'";
27817  case 'q': return "'long long'";
27818  case 'Q': return "'unsigned long long'";
27819  case 'f': return (is_complex ? "'complex float'" : "'float'");
27820  case 'd': return (is_complex ? "'complex double'" : "'double'");
27821  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27822  case 'T': return "a struct";
27823  case 'O': return "Python object";
27824  case 'P': return "a pointer";
27825  case 's': case 'p': return "a string";
27826  case 0: return "end";
27827  default: return "unparseable format string";
27828  }
27829 }
27830 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
27831  switch (ch) {
27832  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27833  case 'h': case 'H': return 2;
27834  case 'i': case 'I': case 'l': case 'L': return 4;
27835  case 'q': case 'Q': return 8;
27836  case 'f': return (is_complex ? 8 : 4);
27837  case 'd': return (is_complex ? 16 : 8);
27838  case 'g': {
27839  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
27840  return 0;
27841  }
27842  case 'O': case 'P': return sizeof(void*);
27843  default:
27844  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27845  return 0;
27846  }
27847 }
27848 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
27849  switch (ch) {
27850  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27851  case 'h': case 'H': return sizeof(short);
27852  case 'i': case 'I': return sizeof(int);
27853  case 'l': case 'L': return sizeof(long);
27854  #ifdef HAVE_LONG_LONG
27855  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
27856  #endif
27857  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
27858  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
27859  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
27860  case 'O': case 'P': return sizeof(void*);
27861  default: {
27862  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27863  return 0;
27864  }
27865  }
27866 }
27867 typedef struct { char c; short x; } __Pyx_st_short;
27868 typedef struct { char c; int x; } __Pyx_st_int;
27869 typedef struct { char c; long x; } __Pyx_st_long;
27870 typedef struct { char c; float x; } __Pyx_st_float;
27871 typedef struct { char c; double x; } __Pyx_st_double;
27872 typedef struct { char c; long double x; } __Pyx_st_longdouble;
27873 typedef struct { char c; void *x; } __Pyx_st_void_p;
27874 #ifdef HAVE_LONG_LONG
27875 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27876 #endif
27877 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
27878  switch (ch) {
27879  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27880  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
27881  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
27882  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
27883 #ifdef HAVE_LONG_LONG
27884  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
27885 #endif
27886  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
27887  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
27888  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
27889  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
27890  default:
27891  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27892  return 0;
27893  }
27894 }
27895 /* These are for computing the padding at the end of the struct to align
27896  on the first member of the struct. This will probably the same as above,
27897  but we don't have any guarantees.
27898  */
27899 typedef struct { short x; char c; } __Pyx_pad_short;
27900 typedef struct { int x; char c; } __Pyx_pad_int;
27901 typedef struct { long x; char c; } __Pyx_pad_long;
27902 typedef struct { float x; char c; } __Pyx_pad_float;
27903 typedef struct { double x; char c; } __Pyx_pad_double;
27904 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
27905 typedef struct { void *x; char c; } __Pyx_pad_void_p;
27906 #ifdef HAVE_LONG_LONG
27907 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
27908 #endif
27909 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
27910  switch (ch) {
27911  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27912  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
27913  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
27914  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
27915 #ifdef HAVE_LONG_LONG
27916  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
27917 #endif
27918  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
27919  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
27920  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
27921  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
27922  default:
27923  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27924  return 0;
27925  }
27926 }
27927 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
27928  switch (ch) {
27929  case 'c':
27930  return 'H';
27931  case 'b': case 'h': case 'i':
27932  case 'l': case 'q': case 's': case 'p':
27933  return 'I';
27934  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
27935  return 'U';
27936  case 'f': case 'd': case 'g':
27937  return (is_complex ? 'C' : 'R');
27938  case 'O':
27939  return 'O';
27940  case 'P':
27941  return 'P';
27942  default: {
27943  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27944  return 0;
27945  }
27946  }
27947 }
27948 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27949  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27950  const char* expected;
27951  const char* quote;
27952  if (ctx->head == NULL) {
27953  expected = "end";
27954  quote = "";
27955  } else {
27956  expected = ctx->head->field->type->name;
27957  quote = "'";
27958  }
27959  PyErr_Format(PyExc_ValueError,
27960  "Buffer dtype mismatch, expected %s%s%s but got %s",
27961  quote, expected, quote,
27962  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27963  } else {
27964  __Pyx_StructField* field = ctx->head->field;
27965  __Pyx_StructField* parent = (ctx->head - 1)->field;
27966  PyErr_Format(PyExc_ValueError,
27967  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27968  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27969  parent->type->name, field->name);
27970  }
27971 }
27972 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27973  char group;
27974  size_t size, offset, arraysize = 1;
27975  if (ctx->enc_type == 0) return 0;
27976  if (ctx->head->field->type->arraysize[0]) {
27977  int i, ndim = 0;
27978  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27979  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27980  ndim = 1;
27981  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27982  PyErr_Format(PyExc_ValueError,
27983  "Expected a dimension of size %zu, got %zu",
27984  ctx->head->field->type->arraysize[0], ctx->enc_count);
27985  return -1;
27986  }
27987  }
27988  if (!ctx->is_valid_array) {
27989  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27990  ctx->head->field->type->ndim, ndim);
27991  return -1;
27992  }
27993  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27994  arraysize *= ctx->head->field->type->arraysize[i];
27995  }
27996  ctx->is_valid_array = 0;
27997  ctx->enc_count = 1;
27998  }
27999  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28000  do {
28001  __Pyx_StructField* field = ctx->head->field;
28002  __Pyx_TypeInfo* type = field->type;
28003  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28004  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28005  } else {
28006  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28007  }
28008  if (ctx->enc_packmode == '@') {
28009  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28010  size_t align_mod_offset;
28011  if (align_at == 0) return -1;
28012  align_mod_offset = ctx->fmt_offset % align_at;
28013  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28014  if (ctx->struct_alignment == 0)
28015  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28016  ctx->is_complex);
28017  }
28018  if (type->size != size || type->typegroup != group) {
28019  if (type->typegroup == 'C' && type->fields != NULL) {
28020  size_t parent_offset = ctx->head->parent_offset + field->offset;
28021  ++ctx->head;
28022  ctx->head->field = type->fields;
28023  ctx->head->parent_offset = parent_offset;
28024  continue;
28025  }
28026  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28027  } else {
28028  __Pyx_BufFmt_RaiseExpected(ctx);
28029  return -1;
28030  }
28031  }
28032  offset = ctx->head->parent_offset + field->offset;
28033  if (ctx->fmt_offset != offset) {
28034  PyErr_Format(PyExc_ValueError,
28035  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28036  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28037  return -1;
28038  }
28039  ctx->fmt_offset += size;
28040  if (arraysize)
28041  ctx->fmt_offset += (arraysize - 1) * size;
28042  --ctx->enc_count;
28043  while (1) {
28044  if (field == &ctx->root) {
28045  ctx->head = NULL;
28046  if (ctx->enc_count != 0) {
28047  __Pyx_BufFmt_RaiseExpected(ctx);
28048  return -1;
28049  }
28050  break;
28051  }
28052  ctx->head->field = ++field;
28053  if (field->type == NULL) {
28054  --ctx->head;
28055  field = ctx->head->field;
28056  continue;
28057  } else if (field->type->typegroup == 'S') {
28058  size_t parent_offset = ctx->head->parent_offset + field->offset;
28059  if (field->type->fields->type == NULL) continue;
28060  field = field->type->fields;
28061  ++ctx->head;
28062  ctx->head->field = field;
28063  ctx->head->parent_offset = parent_offset;
28064  break;
28065  } else {
28066  break;
28067  }
28068  }
28069  } while (ctx->enc_count);
28070  ctx->enc_type = 0;
28071  ctx->is_complex = 0;
28072  return 0;
28073 }
28074 static PyObject *
28075 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
28076 {
28077  const char *ts = *tsp;
28078  int i = 0, number, ndim;
28079  ++ts;
28080  if (ctx->new_count != 1) {
28081  PyErr_SetString(PyExc_ValueError,
28082  "Cannot handle repeated arrays in format string");
28083  return NULL;
28084  }
28085  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28086  ndim = ctx->head->field->type->ndim;
28087  while (*ts && *ts != ')') {
28088  switch (*ts) {
28089  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
28090  default: break;
28091  }
28092  number = __Pyx_BufFmt_ExpectNumber(&ts);
28093  if (number == -1) return NULL;
28094  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
28095  return PyErr_Format(PyExc_ValueError,
28096  "Expected a dimension of size %zu, got %d",
28097  ctx->head->field->type->arraysize[i], number);
28098  if (*ts != ',' && *ts != ')')
28099  return PyErr_Format(PyExc_ValueError,
28100  "Expected a comma in format string, got '%c'", *ts);
28101  if (*ts == ',') ts++;
28102  i++;
28103  }
28104  if (i != ndim)
28105  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
28106  ctx->head->field->type->ndim, i);
28107  if (!*ts) {
28108  PyErr_SetString(PyExc_ValueError,
28109  "Unexpected end of format string, expected ')'");
28110  return NULL;
28111  }
28112  ctx->is_valid_array = 1;
28113  ctx->new_count = 1;
28114  *tsp = ++ts;
28115  return Py_None;
28116 }
28117 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
28118  int got_Z = 0;
28119  while (1) {
28120  switch(*ts) {
28121  case 0:
28122  if (ctx->enc_type != 0 && ctx->head == NULL) {
28123  __Pyx_BufFmt_RaiseExpected(ctx);
28124  return NULL;
28125  }
28126  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28127  if (ctx->head != NULL) {
28128  __Pyx_BufFmt_RaiseExpected(ctx);
28129  return NULL;
28130  }
28131  return ts;
28132  case ' ':
28133  case '\r':
28134  case '\n':
28135  ++ts;
28136  break;
28137  case '<':
28138  if (!__Pyx_Is_Little_Endian()) {
28139  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
28140  return NULL;
28141  }
28142  ctx->new_packmode = '=';
28143  ++ts;
28144  break;
28145  case '>':
28146  case '!':
28147  if (__Pyx_Is_Little_Endian()) {
28148  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
28149  return NULL;
28150  }
28151  ctx->new_packmode = '=';
28152  ++ts;
28153  break;
28154  case '=':
28155  case '@':
28156  case '^':
28157  ctx->new_packmode = *ts++;
28158  break;
28159  case 'T':
28160  {
28161  const char* ts_after_sub;
28162  size_t i, struct_count = ctx->new_count;
28163  size_t struct_alignment = ctx->struct_alignment;
28164  ctx->new_count = 1;
28165  ++ts;
28166  if (*ts != '{') {
28167  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
28168  return NULL;
28169  }
28170  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28171  ctx->enc_type = 0;
28172  ctx->enc_count = 0;
28173  ctx->struct_alignment = 0;
28174  ++ts;
28175  ts_after_sub = ts;
28176  for (i = 0; i != struct_count; ++i) {
28177  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28178  if (!ts_after_sub) return NULL;
28179  }
28180  ts = ts_after_sub;
28181  if (struct_alignment) ctx->struct_alignment = struct_alignment;
28182  }
28183  break;
28184  case '}':
28185  {
28186  size_t alignment = ctx->struct_alignment;
28187  ++ts;
28188  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28189  ctx->enc_type = 0;
28190  if (alignment && ctx->fmt_offset % alignment) {
28191  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28192  }
28193  }
28194  return ts;
28195  case 'x':
28196  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28197  ctx->fmt_offset += ctx->new_count;
28198  ctx->new_count = 1;
28199  ctx->enc_count = 0;
28200  ctx->enc_type = 0;
28201  ctx->enc_packmode = ctx->new_packmode;
28202  ++ts;
28203  break;
28204  case 'Z':
28205  got_Z = 1;
28206  ++ts;
28207  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
28208  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
28209  return NULL;
28210  }
28211  CYTHON_FALLTHROUGH;
28212  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
28213  case 'l': case 'L': case 'q': case 'Q':
28214  case 'f': case 'd': case 'g':
28215  case 'O': case 'p':
28216  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
28217  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
28218  ctx->enc_count += ctx->new_count;
28219  ctx->new_count = 1;
28220  got_Z = 0;
28221  ++ts;
28222  break;
28223  }
28224  CYTHON_FALLTHROUGH;
28225  case 's':
28226  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28227  ctx->enc_count = ctx->new_count;
28228  ctx->enc_packmode = ctx->new_packmode;
28229  ctx->enc_type = *ts;
28230  ctx->is_complex = got_Z;
28231  ++ts;
28232  ctx->new_count = 1;
28233  got_Z = 0;
28234  break;
28235  case ':':
28236  ++ts;
28237  while(*ts != ':') ++ts;
28238  ++ts;
28239  break;
28240  case '(':
28241  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
28242  break;
28243  default:
28244  {
28245  int number = __Pyx_BufFmt_ExpectNumber(&ts);
28246  if (number == -1) return NULL;
28247  ctx->new_count = (size_t)number;
28248  }
28249  }
28250  }
28251 }
28252 
28253 /* TypeInfoCompare */
28254  static int
28255 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28256 {
28257  int i;
28258  if (!a || !b)
28259  return 0;
28260  if (a == b)
28261  return 1;
28262  if (a->size != b->size || a->typegroup != b->typegroup ||
28263  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28264  if (a->typegroup == 'H' || b->typegroup == 'H') {
28265  return a->size == b->size;
28266  } else {
28267  return 0;
28268  }
28269  }
28270  if (a->ndim) {
28271  for (i = 0; i < a->ndim; i++)
28272  if (a->arraysize[i] != b->arraysize[i])
28273  return 0;
28274  }
28275  if (a->typegroup == 'S') {
28276  if (a->flags != b->flags)
28277  return 0;
28278  if (a->fields || b->fields) {
28279  if (!(a->fields && b->fields))
28280  return 0;
28281  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28282  __Pyx_StructField *field_a = a->fields + i;
28283  __Pyx_StructField *field_b = b->fields + i;
28284  if (field_a->offset != field_b->offset ||
28285  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28286  return 0;
28287  }
28288  return !a->fields[i].type && !b->fields[i].type;
28289  }
28290  }
28291  return 1;
28292 }
28293 
28294 /* MemviewSliceValidateAndInit */
28295  static int
28296 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
28297 {
28298  if (buf->shape[dim] <= 1)
28299  return 1;
28300  if (buf->strides) {
28301  if (spec & __Pyx_MEMVIEW_CONTIG) {
28302  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28303  if (unlikely(buf->strides[dim] != sizeof(void *))) {
28304  PyErr_Format(PyExc_ValueError,
28305  "Buffer is not indirectly contiguous "
28306  "in dimension %d.", dim);
28307  goto fail;
28308  }
28309  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
28310  PyErr_SetString(PyExc_ValueError,
28311  "Buffer and memoryview are not contiguous "
28312  "in the same dimension.");
28313  goto fail;
28314  }
28315  }
28316  if (spec & __Pyx_MEMVIEW_FOLLOW) {
28317  Py_ssize_t stride = buf->strides[dim];
28318  if (stride < 0)
28319  stride = -stride;
28320  if (unlikely(stride < buf->itemsize)) {
28321  PyErr_SetString(PyExc_ValueError,
28322  "Buffer and memoryview are not contiguous "
28323  "in the same dimension.");
28324  goto fail;
28325  }
28326  }
28327  } else {
28328  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
28329  PyErr_Format(PyExc_ValueError,
28330  "C-contiguous buffer is not contiguous in "
28331  "dimension %d", dim);
28332  goto fail;
28333  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
28334  PyErr_Format(PyExc_ValueError,
28335  "C-contiguous buffer is not indirect in "
28336  "dimension %d", dim);
28337  goto fail;
28338  } else if (unlikely(buf->suboffsets)) {
28339  PyErr_SetString(PyExc_ValueError,
28340  "Buffer exposes suboffsets but no strides");
28341  goto fail;
28342  }
28343  }
28344  return 1;
28345 fail:
28346  return 0;
28347 }
28348 static int
28349 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
28350 {
28351  if (spec & __Pyx_MEMVIEW_DIRECT) {
28352  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
28353  PyErr_Format(PyExc_ValueError,
28354  "Buffer not compatible with direct access "
28355  "in dimension %d.", dim);
28356  goto fail;
28357  }
28358  }
28359  if (spec & __Pyx_MEMVIEW_PTR) {
28360  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28361  PyErr_Format(PyExc_ValueError,
28362  "Buffer is not indirectly accessible "
28363  "in dimension %d.", dim);
28364  goto fail;
28365  }
28366  }
28367  return 1;
28368 fail:
28369  return 0;
28370 }
28371 static int
28372 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
28373 {
28374  int i;
28375  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28376  Py_ssize_t stride = 1;
28377  for (i = 0; i < ndim; i++) {
28378  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28379  PyErr_SetString(PyExc_ValueError,
28380  "Buffer not fortran contiguous.");
28381  goto fail;
28382  }
28383  stride = stride * buf->shape[i];
28384  }
28385  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28386  Py_ssize_t stride = 1;
28387  for (i = ndim - 1; i >- 1; i--) {
28388  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28389  PyErr_SetString(PyExc_ValueError,
28390  "Buffer not C contiguous.");
28391  goto fail;
28392  }
28393  stride = stride * buf->shape[i];
28394  }
28395  }
28396  return 1;
28397 fail:
28398  return 0;
28399 }
28400 static int __Pyx_ValidateAndInit_memviewslice(
28401  int *axes_specs,
28402  int c_or_f_flag,
28403  int buf_flags,
28404  int ndim,
28405  __Pyx_TypeInfo *dtype,
28406  __Pyx_BufFmt_StackElem stack[],
28407  __Pyx_memviewslice *memviewslice,
28408  PyObject *original_obj)
28409 {
28410  struct __pyx_memoryview_obj *memview, *new_memview;
28411  __Pyx_RefNannyDeclarations
28412  Py_buffer *buf;
28413  int i, spec = 0, retval = -1;
28414  __Pyx_BufFmt_Context ctx;
28415  int from_memoryview = __pyx_memoryview_check(original_obj);
28416  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
28417  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
28418  original_obj)->typeinfo)) {
28419  memview = (struct __pyx_memoryview_obj *) original_obj;
28420  new_memview = NULL;
28421  } else {
28422  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28423  original_obj, buf_flags, 0, dtype);
28424  new_memview = memview;
28425  if (unlikely(!memview))
28426  goto fail;
28427  }
28428  buf = &memview->view;
28429  if (unlikely(buf->ndim != ndim)) {
28430  PyErr_Format(PyExc_ValueError,
28431  "Buffer has wrong number of dimensions (expected %d, got %d)",
28432  ndim, buf->ndim);
28433  goto fail;
28434  }
28435  if (new_memview) {
28436  __Pyx_BufFmt_Init(&ctx, stack, dtype);
28437  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
28438  }
28439  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
28440  PyErr_Format(PyExc_ValueError,
28441  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
28442  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
28443  buf->itemsize,
28444  (buf->itemsize > 1) ? "s" : "",
28445  dtype->name,
28446  dtype->size,
28447  (dtype->size > 1) ? "s" : "");
28448  goto fail;
28449  }
28450  if (buf->len > 0) {
28451  for (i = 0; i < ndim; i++) {
28452  spec = axes_specs[i];
28453  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28454  goto fail;
28455  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28456  goto fail;
28457  }
28458  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28459  goto fail;
28460  }
28461  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28462  new_memview != NULL) == -1)) {
28463  goto fail;
28464  }
28465  retval = 0;
28466  goto no_fail;
28467 fail:
28468  Py_XDECREF(new_memview);
28469  retval = -1;
28470 no_fail:
28471  __Pyx_RefNannyFinishContext();
28472  return retval;
28473 }
28474 
28475 /* ObjectToMemviewSlice */
28476  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28477  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28478  __Pyx_BufFmt_StackElem stack[1];
28479  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28480  int retcode;
28481  if (obj == Py_None) {
28482  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28483  return result;
28484  }
28485  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28486  PyBUF_RECORDS_RO | writable_flag, 1,
28487  &__Pyx_TypeInfo_double, stack,
28488  &result, obj);
28489  if (unlikely(retcode == -1))
28490  goto __pyx_fail;
28491  return result;
28492 __pyx_fail:
28493  result.memview = NULL;
28494  result.data = NULL;
28495  return result;
28496 }
28497 
28498 /* CIntToPy */
28499  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28500  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
28501  const int is_unsigned = neg_one > const_zero;
28502  if (is_unsigned) {
28503  if (sizeof(int) < sizeof(long)) {
28504  return PyInt_FromLong((long) value);
28505  } else if (sizeof(int) <= sizeof(unsigned long)) {
28506  return PyLong_FromUnsignedLong((unsigned long) value);
28507 #ifdef HAVE_LONG_LONG
28508  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28509  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28510 #endif
28511  }
28512  } else {
28513  if (sizeof(int) <= sizeof(long)) {
28514  return PyInt_FromLong((long) value);
28515 #ifdef HAVE_LONG_LONG
28516  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28517  return PyLong_FromLongLong((PY_LONG_LONG) value);
28518 #endif
28519  }
28520  }
28521  {
28522  int one = 1; int little = (int)*(unsigned char *)&one;
28523  unsigned char *bytes = (unsigned char *)&value;
28524  return _PyLong_FromByteArray(bytes, sizeof(int),
28525  little, !is_unsigned);
28526  }
28527 }
28528 
28529 /* CIntFromPyVerify */
28530  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28531  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28532 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28533  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28534 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28535  {\
28536  func_type value = func_value;\
28537  if (sizeof(target_type) < sizeof(func_type)) {\
28538  if (unlikely(value != (func_type) (target_type) value)) {\
28539  func_type zero = 0;\
28540  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28541  return (target_type) -1;\
28542  if (is_unsigned && unlikely(value < zero))\
28543  goto raise_neg_overflow;\
28544  else\
28545  goto raise_overflow;\
28546  }\
28547  }\
28548  return (target_type) value;\
28549  }
28550 
28551 /* CIntToPy */
28552  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28553  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28554  const int is_unsigned = neg_one > const_zero;
28555  if (is_unsigned) {
28556  if (sizeof(long) < sizeof(long)) {
28557  return PyInt_FromLong((long) value);
28558  } else if (sizeof(long) <= sizeof(unsigned long)) {
28559  return PyLong_FromUnsignedLong((unsigned long) value);
28560 #ifdef HAVE_LONG_LONG
28561  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28562  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28563 #endif
28564  }
28565  } else {
28566  if (sizeof(long) <= sizeof(long)) {
28567  return PyInt_FromLong((long) value);
28568 #ifdef HAVE_LONG_LONG
28569  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28570  return PyLong_FromLongLong((PY_LONG_LONG) value);
28571 #endif
28572  }
28573  }
28574  {
28575  int one = 1; int little = (int)*(unsigned char *)&one;
28576  unsigned char *bytes = (unsigned char *)&value;
28577  return _PyLong_FromByteArray(bytes, sizeof(long),
28578  little, !is_unsigned);
28579  }
28580 }
28581 
28582 /* Declarations */
28583  #if CYTHON_CCOMPLEX
28584  #ifdef __cplusplus
28585  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28586  return ::std::complex< float >(x, y);
28587  }
28588  #else
28589  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28590  return x + y*(__pyx_t_float_complex)_Complex_I;
28591  }
28592  #endif
28593 #else
28594  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28595  __pyx_t_float_complex z;
28596  z.real = x;
28597  z.imag = y;
28598  return z;
28599  }
28600 #endif
28601 
28602 /* Arithmetic */
28603  #if CYTHON_CCOMPLEX
28604 #else
28605  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28606  return (a.real == b.real) && (a.imag == b.imag);
28607  }
28608  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28609  __pyx_t_float_complex z;
28610  z.real = a.real + b.real;
28611  z.imag = a.imag + b.imag;
28612  return z;
28613  }
28614  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28615  __pyx_t_float_complex z;
28616  z.real = a.real - b.real;
28617  z.imag = a.imag - b.imag;
28618  return z;
28619  }
28620  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28621  __pyx_t_float_complex z;
28622  z.real = a.real * b.real - a.imag * b.imag;
28623  z.imag = a.real * b.imag + a.imag * b.real;
28624  return z;
28625  }
28626  #if 1
28627  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28628  if (b.imag == 0) {
28629  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28630  } else if (fabsf(b.real) >= fabsf(b.imag)) {
28631  if (b.real == 0 && b.imag == 0) {
28632  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28633  } else {
28634  float r = b.imag / b.real;
28635  float s = (float)(1.0) / (b.real + b.imag * r);
28636  return __pyx_t_float_complex_from_parts(
28637  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28638  }
28639  } else {
28640  float r = b.real / b.imag;
28641  float s = (float)(1.0) / (b.imag + b.real * r);
28642  return __pyx_t_float_complex_from_parts(
28643  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28644  }
28645  }
28646  #else
28647  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28648  if (b.imag == 0) {
28649  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28650  } else {
28651  float denom = b.real * b.real + b.imag * b.imag;
28652  return __pyx_t_float_complex_from_parts(
28653  (a.real * b.real + a.imag * b.imag) / denom,
28654  (a.imag * b.real - a.real * b.imag) / denom);
28655  }
28656  }
28657  #endif
28658  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28659  __pyx_t_float_complex z;
28660  z.real = -a.real;
28661  z.imag = -a.imag;
28662  return z;
28663  }
28664  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28665  return (a.real == 0) && (a.imag == 0);
28666  }
28667  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28668  __pyx_t_float_complex z;
28669  z.real = a.real;
28670  z.imag = -a.imag;
28671  return z;
28672  }
28673  #if 1
28674  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
28675  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28676  return sqrtf(z.real*z.real + z.imag*z.imag);
28677  #else
28678  return hypotf(z.real, z.imag);
28679  #endif
28680  }
28681  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28682  __pyx_t_float_complex z;
28683  float r, lnr, theta, z_r, z_theta;
28684  if (b.imag == 0 && b.real == (int)b.real) {
28685  if (b.real < 0) {
28686  float denom = a.real * a.real + a.imag * a.imag;
28687  a.real = a.real / denom;
28688  a.imag = -a.imag / denom;
28689  b.real = -b.real;
28690  }
28691  switch ((int)b.real) {
28692  case 0:
28693  z.real = 1;
28694  z.imag = 0;
28695  return z;
28696  case 1:
28697  return a;
28698  case 2:
28699  return __Pyx_c_prod_float(a, a);
28700  case 3:
28701  z = __Pyx_c_prod_float(a, a);
28702  return __Pyx_c_prod_float(z, a);
28703  case 4:
28704  z = __Pyx_c_prod_float(a, a);
28705  return __Pyx_c_prod_float(z, z);
28706  }
28707  }
28708  if (a.imag == 0) {
28709  if (a.real == 0) {
28710  return a;
28711  } else if (b.imag == 0) {
28712  z.real = powf(a.real, b.real);
28713  z.imag = 0;
28714  return z;
28715  } else if (a.real > 0) {
28716  r = a.real;
28717  theta = 0;
28718  } else {
28719  r = -a.real;
28720  theta = atan2f(0.0, -1.0);
28721  }
28722  } else {
28723  r = __Pyx_c_abs_float(a);
28724  theta = atan2f(a.imag, a.real);
28725  }
28726  lnr = logf(r);
28727  z_r = expf(lnr * b.real - theta * b.imag);
28728  z_theta = theta * b.real + lnr * b.imag;
28729  z.real = z_r * cosf(z_theta);
28730  z.imag = z_r * sinf(z_theta);
28731  return z;
28732  }
28733  #endif
28734 #endif
28735 
28736 /* Declarations */
28737  #if CYTHON_CCOMPLEX
28738  #ifdef __cplusplus
28739  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28740  return ::std::complex< double >(x, y);
28741  }
28742  #else
28743  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28744  return x + y*(__pyx_t_double_complex)_Complex_I;
28745  }
28746  #endif
28747 #else
28748  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28749  __pyx_t_double_complex z;
28750  z.real = x;
28751  z.imag = y;
28752  return z;
28753  }
28754 #endif
28755 
28756 /* Arithmetic */
28757  #if CYTHON_CCOMPLEX
28758 #else
28759  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28760  return (a.real == b.real) && (a.imag == b.imag);
28761  }
28762  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28763  __pyx_t_double_complex z;
28764  z.real = a.real + b.real;
28765  z.imag = a.imag + b.imag;
28766  return z;
28767  }
28768  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28769  __pyx_t_double_complex z;
28770  z.real = a.real - b.real;
28771  z.imag = a.imag - b.imag;
28772  return z;
28773  }
28774  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28775  __pyx_t_double_complex z;
28776  z.real = a.real * b.real - a.imag * b.imag;
28777  z.imag = a.real * b.imag + a.imag * b.real;
28778  return z;
28779  }
28780  #if 1
28781  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28782  if (b.imag == 0) {
28783  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28784  } else if (fabs(b.real) >= fabs(b.imag)) {
28785  if (b.real == 0 && b.imag == 0) {
28786  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28787  } else {
28788  double r = b.imag / b.real;
28789  double s = (double)(1.0) / (b.real + b.imag * r);
28790  return __pyx_t_double_complex_from_parts(
28791  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28792  }
28793  } else {
28794  double r = b.real / b.imag;
28795  double s = (double)(1.0) / (b.imag + b.real * r);
28796  return __pyx_t_double_complex_from_parts(
28797  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28798  }
28799  }
28800  #else
28801  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28802  if (b.imag == 0) {
28803  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28804  } else {
28805  double denom = b.real * b.real + b.imag * b.imag;
28806  return __pyx_t_double_complex_from_parts(
28807  (a.real * b.real + a.imag * b.imag) / denom,
28808  (a.imag * b.real - a.real * b.imag) / denom);
28809  }
28810  }
28811  #endif
28812  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28813  __pyx_t_double_complex z;
28814  z.real = -a.real;
28815  z.imag = -a.imag;
28816  return z;
28817  }
28818  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28819  return (a.real == 0) && (a.imag == 0);
28820  }
28821  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28822  __pyx_t_double_complex z;
28823  z.real = a.real;
28824  z.imag = -a.imag;
28825  return z;
28826  }
28827  #if 1
28828  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
28829  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28830  return sqrt(z.real*z.real + z.imag*z.imag);
28831  #else
28832  return hypot(z.real, z.imag);
28833  #endif
28834  }
28835  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28836  __pyx_t_double_complex z;
28837  double r, lnr, theta, z_r, z_theta;
28838  if (b.imag == 0 && b.real == (int)b.real) {
28839  if (b.real < 0) {
28840  double denom = a.real * a.real + a.imag * a.imag;
28841  a.real = a.real / denom;
28842  a.imag = -a.imag / denom;
28843  b.real = -b.real;
28844  }
28845  switch ((int)b.real) {
28846  case 0:
28847  z.real = 1;
28848  z.imag = 0;
28849  return z;
28850  case 1:
28851  return a;
28852  case 2:
28853  return __Pyx_c_prod_double(a, a);
28854  case 3:
28855  z = __Pyx_c_prod_double(a, a);
28856  return __Pyx_c_prod_double(z, a);
28857  case 4:
28858  z = __Pyx_c_prod_double(a, a);
28859  return __Pyx_c_prod_double(z, z);
28860  }
28861  }
28862  if (a.imag == 0) {
28863  if (a.real == 0) {
28864  return a;
28865  } else if (b.imag == 0) {
28866  z.real = pow(a.real, b.real);
28867  z.imag = 0;
28868  return z;
28869  } else if (a.real > 0) {
28870  r = a.real;
28871  theta = 0;
28872  } else {
28873  r = -a.real;
28874  theta = atan2(0.0, -1.0);
28875  }
28876  } else {
28877  r = __Pyx_c_abs_double(a);
28878  theta = atan2(a.imag, a.real);
28879  }
28880  lnr = log(r);
28881  z_r = exp(lnr * b.real - theta * b.imag);
28882  z_theta = theta * b.real + lnr * b.imag;
28883  z.real = z_r * cos(z_theta);
28884  z.imag = z_r * sin(z_theta);
28885  return z;
28886  }
28887  #endif
28888 #endif
28889 
28890 /* CIntToPy */
28891  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
28892  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
28893  const int is_unsigned = neg_one > const_zero;
28894  if (is_unsigned) {
28895  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
28896  return PyInt_FromLong((long) value);
28897  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
28898  return PyLong_FromUnsignedLong((unsigned long) value);
28899 #ifdef HAVE_LONG_LONG
28900  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
28901  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28902 #endif
28903  }
28904  } else {
28905  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
28906  return PyInt_FromLong((long) value);
28907 #ifdef HAVE_LONG_LONG
28908  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
28909  return PyLong_FromLongLong((PY_LONG_LONG) value);
28910 #endif
28911  }
28912  }
28913  {
28914  int one = 1; int little = (int)*(unsigned char *)&one;
28915  unsigned char *bytes = (unsigned char *)&value;
28916  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
28917  little, !is_unsigned);
28918  }
28919 }
28920 
28921 /* MemviewSliceCopyTemplate */
28922  static __Pyx_memviewslice
28923 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28924  const char *mode, int ndim,
28925  size_t sizeof_dtype, int contig_flag,
28926  int dtype_is_object)
28927 {
28928  __Pyx_RefNannyDeclarations
28929  int i;
28930  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28931  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28932  Py_buffer *buf = &from_memview->view;
28933  PyObject *shape_tuple = NULL;
28934  PyObject *temp_int = NULL;
28935  struct __pyx_array_obj *array_obj = NULL;
28936  struct __pyx_memoryview_obj *memview_obj = NULL;
28937  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28938  for (i = 0; i < ndim; i++) {
28939  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28940  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28941  "indirect dimensions (axis %d)", i);
28942  goto fail;
28943  }
28944  }
28945  shape_tuple = PyTuple_New(ndim);
28946  if (unlikely(!shape_tuple)) {
28947  goto fail;
28948  }
28949  __Pyx_GOTREF(shape_tuple);
28950  for(i = 0; i < ndim; i++) {
28951  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28952  if(unlikely(!temp_int)) {
28953  goto fail;
28954  } else {
28955  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28956  temp_int = NULL;
28957  }
28958  }
28959  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28960  if (unlikely(!array_obj)) {
28961  goto fail;
28962  }
28963  __Pyx_GOTREF(array_obj);
28964  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28965  (PyObject *) array_obj, contig_flag,
28966  dtype_is_object,
28967  from_mvs->memview->typeinfo);
28968  if (unlikely(!memview_obj))
28969  goto fail;
28970  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28971  goto fail;
28972  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28973  dtype_is_object) < 0))
28974  goto fail;
28975  goto no_fail;
28976 fail:
28977  __Pyx_XDECREF(new_mvs.memview);
28978  new_mvs.memview = NULL;
28979  new_mvs.data = NULL;
28980 no_fail:
28981  __Pyx_XDECREF(shape_tuple);
28982  __Pyx_XDECREF(temp_int);
28983  __Pyx_XDECREF(array_obj);
28984  __Pyx_RefNannyFinishContext();
28985  return new_mvs;
28986 }
28987 
28988 /* CIntFromPy */
28989  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28990  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
28991  const int is_unsigned = neg_one > const_zero;
28992 #if PY_MAJOR_VERSION < 3
28993  if (likely(PyInt_Check(x))) {
28994  if (sizeof(int) < sizeof(long)) {
28995  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28996  } else {
28997  long val = PyInt_AS_LONG(x);
28998  if (is_unsigned && unlikely(val < 0)) {
28999  goto raise_neg_overflow;
29000  }
29001  return (int) val;
29002  }
29003  } else
29004 #endif
29005  if (likely(PyLong_Check(x))) {
29006  if (is_unsigned) {
29007 #if CYTHON_USE_PYLONG_INTERNALS
29008  const digit* digits = ((PyLongObject*)x)->ob_digit;
29009  switch (Py_SIZE(x)) {
29010  case 0: return (int) 0;
29011  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
29012  case 2:
29013  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
29014  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29015  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29016  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
29017  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29018  }
29019  }
29020  break;
29021  case 3:
29022  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
29023  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29024  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29025  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
29026  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29027  }
29028  }
29029  break;
29030  case 4:
29031  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
29032  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29033  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29034  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
29035  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29036  }
29037  }
29038  break;
29039  }
29040 #endif
29041 #if CYTHON_COMPILING_IN_CPYTHON
29042  if (unlikely(Py_SIZE(x) < 0)) {
29043  goto raise_neg_overflow;
29044  }
29045 #else
29046  {
29047  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29048  if (unlikely(result < 0))
29049  return (int) -1;
29050  if (unlikely(result == 1))
29051  goto raise_neg_overflow;
29052  }
29053 #endif
29054  if (sizeof(int) <= sizeof(unsigned long)) {
29055  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
29056 #ifdef HAVE_LONG_LONG
29057  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
29058  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29059 #endif
29060  }
29061  } else {
29062 #if CYTHON_USE_PYLONG_INTERNALS
29063  const digit* digits = ((PyLongObject*)x)->ob_digit;
29064  switch (Py_SIZE(x)) {
29065  case 0: return (int) 0;
29066  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
29067  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
29068  case -2:
29069  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
29070  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29071  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29072  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29073  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29074  }
29075  }
29076  break;
29077  case 2:
29078  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
29079  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29080  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29081  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29082  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29083  }
29084  }
29085  break;
29086  case -3:
29087  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29088  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29089  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29090  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29091  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29092  }
29093  }
29094  break;
29095  case 3:
29096  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
29097  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29098  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29099  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29100  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29101  }
29102  }
29103  break;
29104  case -4:
29105  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29106  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29107  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29108  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
29109  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29110  }
29111  }
29112  break;
29113  case 4:
29114  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
29115  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29116  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29117  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
29118  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29119  }
29120  }
29121  break;
29122  }
29123 #endif
29124  if (sizeof(int) <= sizeof(long)) {
29125  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
29126 #ifdef HAVE_LONG_LONG
29127  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
29128  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
29129 #endif
29130  }
29131  }
29132  {
29133 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29134  PyErr_SetString(PyExc_RuntimeError,
29135  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29136 #else
29137  int val;
29138  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29139  #if PY_MAJOR_VERSION < 3
29140  if (likely(v) && !PyLong_Check(v)) {
29141  PyObject *tmp = v;
29142  v = PyNumber_Long(tmp);
29143  Py_DECREF(tmp);
29144  }
29145  #endif
29146  if (likely(v)) {
29147  int one = 1; int is_little = (int)*(unsigned char *)&one;
29148  unsigned char *bytes = (unsigned char *)&val;
29149  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29150  bytes, sizeof(val),
29151  is_little, !is_unsigned);
29152  Py_DECREF(v);
29153  if (likely(!ret))
29154  return val;
29155  }
29156 #endif
29157  return (int) -1;
29158  }
29159  } else {
29160  int val;
29161  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29162  if (!tmp) return (int) -1;
29163  val = __Pyx_PyInt_As_int(tmp);
29164  Py_DECREF(tmp);
29165  return val;
29166  }
29167 raise_overflow:
29168  PyErr_SetString(PyExc_OverflowError,
29169  "value too large to convert to int");
29170  return (int) -1;
29171 raise_neg_overflow:
29172  PyErr_SetString(PyExc_OverflowError,
29173  "can't convert negative value to int");
29174  return (int) -1;
29175 }
29176 
29177 /* CIntFromPy */
29178  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
29179  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
29180  const int is_unsigned = neg_one > const_zero;
29181 #if PY_MAJOR_VERSION < 3
29182  if (likely(PyInt_Check(x))) {
29183  if (sizeof(long) < sizeof(long)) {
29184  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
29185  } else {
29186  long val = PyInt_AS_LONG(x);
29187  if (is_unsigned && unlikely(val < 0)) {
29188  goto raise_neg_overflow;
29189  }
29190  return (long) val;
29191  }
29192  } else
29193 #endif
29194  if (likely(PyLong_Check(x))) {
29195  if (is_unsigned) {
29196 #if CYTHON_USE_PYLONG_INTERNALS
29197  const digit* digits = ((PyLongObject*)x)->ob_digit;
29198  switch (Py_SIZE(x)) {
29199  case 0: return (long) 0;
29200  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
29201  case 2:
29202  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
29203  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29204  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29205  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
29206  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29207  }
29208  }
29209  break;
29210  case 3:
29211  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
29212  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29213  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29214  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
29215  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29216  }
29217  }
29218  break;
29219  case 4:
29220  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
29221  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29222  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29223  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
29224  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29225  }
29226  }
29227  break;
29228  }
29229 #endif
29230 #if CYTHON_COMPILING_IN_CPYTHON
29231  if (unlikely(Py_SIZE(x) < 0)) {
29232  goto raise_neg_overflow;
29233  }
29234 #else
29235  {
29236  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29237  if (unlikely(result < 0))
29238  return (long) -1;
29239  if (unlikely(result == 1))
29240  goto raise_neg_overflow;
29241  }
29242 #endif
29243  if (sizeof(long) <= sizeof(unsigned long)) {
29244  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
29245 #ifdef HAVE_LONG_LONG
29246  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
29247  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29248 #endif
29249  }
29250  } else {
29251 #if CYTHON_USE_PYLONG_INTERNALS
29252  const digit* digits = ((PyLongObject*)x)->ob_digit;
29253  switch (Py_SIZE(x)) {
29254  case 0: return (long) 0;
29255  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
29256  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
29257  case -2:
29258  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
29259  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29260  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29261  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29262  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29263  }
29264  }
29265  break;
29266  case 2:
29267  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
29268  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29269  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29270  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29271  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29272  }
29273  }
29274  break;
29275  case -3:
29276  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29277  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29278  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29279  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29280  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29281  }
29282  }
29283  break;
29284  case 3:
29285  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
29286  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29287  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29288  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29289  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29290  }
29291  }
29292  break;
29293  case -4:
29294  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29295  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29296  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29297  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
29298  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29299  }
29300  }
29301  break;
29302  case 4:
29303  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
29304  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29305  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29306  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
29307  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29308  }
29309  }
29310  break;
29311  }
29312 #endif
29313  if (sizeof(long) <= sizeof(long)) {
29314  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
29315 #ifdef HAVE_LONG_LONG
29316  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
29317  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
29318 #endif
29319  }
29320  }
29321  {
29322 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29323  PyErr_SetString(PyExc_RuntimeError,
29324  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29325 #else
29326  long val;
29327  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29328  #if PY_MAJOR_VERSION < 3
29329  if (likely(v) && !PyLong_Check(v)) {
29330  PyObject *tmp = v;
29331  v = PyNumber_Long(tmp);
29332  Py_DECREF(tmp);
29333  }
29334  #endif
29335  if (likely(v)) {
29336  int one = 1; int is_little = (int)*(unsigned char *)&one;
29337  unsigned char *bytes = (unsigned char *)&val;
29338  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29339  bytes, sizeof(val),
29340  is_little, !is_unsigned);
29341  Py_DECREF(v);
29342  if (likely(!ret))
29343  return val;
29344  }
29345 #endif
29346  return (long) -1;
29347  }
29348  } else {
29349  long val;
29350  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29351  if (!tmp) return (long) -1;
29352  val = __Pyx_PyInt_As_long(tmp);
29353  Py_DECREF(tmp);
29354  return val;
29355  }
29356 raise_overflow:
29357  PyErr_SetString(PyExc_OverflowError,
29358  "value too large to convert to long");
29359  return (long) -1;
29360 raise_neg_overflow:
29361  PyErr_SetString(PyExc_OverflowError,
29362  "can't convert negative value to long");
29363  return (long) -1;
29364 }
29365 
29366 /* CIntFromPy */
29367  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
29368  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
29369  const int is_unsigned = neg_one > const_zero;
29370 #if PY_MAJOR_VERSION < 3
29371  if (likely(PyInt_Check(x))) {
29372  if (sizeof(char) < sizeof(long)) {
29373  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
29374  } else {
29375  long val = PyInt_AS_LONG(x);
29376  if (is_unsigned && unlikely(val < 0)) {
29377  goto raise_neg_overflow;
29378  }
29379  return (char) val;
29380  }
29381  } else
29382 #endif
29383  if (likely(PyLong_Check(x))) {
29384  if (is_unsigned) {
29385 #if CYTHON_USE_PYLONG_INTERNALS
29386  const digit* digits = ((PyLongObject*)x)->ob_digit;
29387  switch (Py_SIZE(x)) {
29388  case 0: return (char) 0;
29389  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
29390  case 2:
29391  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29392  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29393  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29394  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
29395  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29396  }
29397  }
29398  break;
29399  case 3:
29400  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29401  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29402  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29403  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
29404  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29405  }
29406  }
29407  break;
29408  case 4:
29409  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29410  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29411  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29412  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
29413  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29414  }
29415  }
29416  break;
29417  }
29418 #endif
29419 #if CYTHON_COMPILING_IN_CPYTHON
29420  if (unlikely(Py_SIZE(x) < 0)) {
29421  goto raise_neg_overflow;
29422  }
29423 #else
29424  {
29425  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29426  if (unlikely(result < 0))
29427  return (char) -1;
29428  if (unlikely(result == 1))
29429  goto raise_neg_overflow;
29430  }
29431 #endif
29432  if (sizeof(char) <= sizeof(unsigned long)) {
29433  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
29434 #ifdef HAVE_LONG_LONG
29435  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
29436  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29437 #endif
29438  }
29439  } else {
29440 #if CYTHON_USE_PYLONG_INTERNALS
29441  const digit* digits = ((PyLongObject*)x)->ob_digit;
29442  switch (Py_SIZE(x)) {
29443  case 0: return (char) 0;
29444  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
29445  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
29446  case -2:
29447  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
29448  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29449  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29450  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29451  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29452  }
29453  }
29454  break;
29455  case 2:
29456  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29457  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29458  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29459  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29460  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29461  }
29462  }
29463  break;
29464  case -3:
29465  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29466  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29467  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29468  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29469  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29470  }
29471  }
29472  break;
29473  case 3:
29474  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29475  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29476  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29477  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29478  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29479  }
29480  }
29481  break;
29482  case -4:
29483  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29484  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29485  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29486  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29487  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29488  }
29489  }
29490  break;
29491  case 4:
29492  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29493  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29494  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29495  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29496  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29497  }
29498  }
29499  break;
29500  }
29501 #endif
29502  if (sizeof(char) <= sizeof(long)) {
29503  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
29504 #ifdef HAVE_LONG_LONG
29505  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
29506  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
29507 #endif
29508  }
29509  }
29510  {
29511 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29512  PyErr_SetString(PyExc_RuntimeError,
29513  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29514 #else
29515  char val;
29516  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29517  #if PY_MAJOR_VERSION < 3
29518  if (likely(v) && !PyLong_Check(v)) {
29519  PyObject *tmp = v;
29520  v = PyNumber_Long(tmp);
29521  Py_DECREF(tmp);
29522  }
29523  #endif
29524  if (likely(v)) {
29525  int one = 1; int is_little = (int)*(unsigned char *)&one;
29526  unsigned char *bytes = (unsigned char *)&val;
29527  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29528  bytes, sizeof(val),
29529  is_little, !is_unsigned);
29530  Py_DECREF(v);
29531  if (likely(!ret))
29532  return val;
29533  }
29534 #endif
29535  return (char) -1;
29536  }
29537  } else {
29538  char val;
29539  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29540  if (!tmp) return (char) -1;
29541  val = __Pyx_PyInt_As_char(tmp);
29542  Py_DECREF(tmp);
29543  return val;
29544  }
29545 raise_overflow:
29546  PyErr_SetString(PyExc_OverflowError,
29547  "value too large to convert to char");
29548  return (char) -1;
29549 raise_neg_overflow:
29550  PyErr_SetString(PyExc_OverflowError,
29551  "can't convert negative value to char");
29552  return (char) -1;
29553 }
29554 
29555 /* CheckBinaryVersion */
29556  static int __Pyx_check_binary_version(void) {
29557  char ctversion[4], rtversion[4];
29558  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29559  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29560  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29561  char message[200];
29562  PyOS_snprintf(message, sizeof(message),
29563  "compiletime version %s of module '%.100s' "
29564  "does not match runtime version %s",
29565  ctversion, __Pyx_MODULE_NAME, rtversion);
29566  return PyErr_WarnEx(NULL, message, 1);
29567  }
29568  return 0;
29569 }
29570 
29571 /* InitStrings */
29572  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29573  while (t->p) {
29574  #if PY_MAJOR_VERSION < 3
29575  if (t->is_unicode) {
29576  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29577  } else if (t->intern) {
29578  *t->p = PyString_InternFromString(t->s);
29579  } else {
29580  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29581  }
29582  #else
29583  if (t->is_unicode | t->is_str) {
29584  if (t->intern) {
29585  *t->p = PyUnicode_InternFromString(t->s);
29586  } else if (t->encoding) {
29587  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29588  } else {
29589  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29590  }
29591  } else {
29592  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29593  }
29594  #endif
29595  if (!*t->p)
29596  return -1;
29597  if (PyObject_Hash(*t->p) == -1)
29598  return -1;
29599  ++t;
29600  }
29601  return 0;
29602 }
29603 
29604 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29605  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29606 }
29607 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29608  Py_ssize_t ignore;
29609  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29610 }
29611 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29612 #if !CYTHON_PEP393_ENABLED
29613 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29614  char* defenc_c;
29615  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29616  if (!defenc) return NULL;
29617  defenc_c = PyBytes_AS_STRING(defenc);
29618 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29619  {
29620  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29621  char* c;
29622  for (c = defenc_c; c < end; c++) {
29623  if ((unsigned char) (*c) >= 128) {
29624  PyUnicode_AsASCIIString(o);
29625  return NULL;
29626  }
29627  }
29628  }
29629 #endif
29630  *length = PyBytes_GET_SIZE(defenc);
29631  return defenc_c;
29632 }
29633 #else
29634 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29635  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29636 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29637  if (likely(PyUnicode_IS_ASCII(o))) {
29638  *length = PyUnicode_GET_LENGTH(o);
29639  return PyUnicode_AsUTF8(o);
29640  } else {
29641  PyUnicode_AsASCIIString(o);
29642  return NULL;
29643  }
29644 #else
29645  return PyUnicode_AsUTF8AndSize(o, length);
29646 #endif
29647 }
29648 #endif
29649 #endif
29650 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29651 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29652  if (
29653 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29654  __Pyx_sys_getdefaultencoding_not_ascii &&
29655 #endif
29656  PyUnicode_Check(o)) {
29657  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29658  } else
29659 #endif
29660 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29661  if (PyByteArray_Check(o)) {
29662  *length = PyByteArray_GET_SIZE(o);
29663  return PyByteArray_AS_STRING(o);
29664  } else
29665 #endif
29666  {
29667  char* result;
29668  int r = PyBytes_AsStringAndSize(o, &result, length);
29669  if (unlikely(r < 0)) {
29670  return NULL;
29671  } else {
29672  return result;
29673  }
29674  }
29675 }
29676 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29677  int is_true = x == Py_True;
29678  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29679  else return PyObject_IsTrue(x);
29680 }
29681 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29682  int retval;
29683  if (unlikely(!x)) return -1;
29684  retval = __Pyx_PyObject_IsTrue(x);
29685  Py_DECREF(x);
29686  return retval;
29687 }
29688 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29689 #if PY_MAJOR_VERSION >= 3
29690  if (PyLong_Check(result)) {
29691  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29692  "__int__ returned non-int (type %.200s). "
29693  "The ability to return an instance of a strict subclass of int "
29694  "is deprecated, and may be removed in a future version of Python.",
29695  Py_TYPE(result)->tp_name)) {
29696  Py_DECREF(result);
29697  return NULL;
29698  }
29699  return result;
29700  }
29701 #endif
29702  PyErr_Format(PyExc_TypeError,
29703  "__%.4s__ returned non-%.4s (type %.200s)",
29704  type_name, type_name, Py_TYPE(result)->tp_name);
29705  Py_DECREF(result);
29706  return NULL;
29707 }
29708 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29709 #if CYTHON_USE_TYPE_SLOTS
29710  PyNumberMethods *m;
29711 #endif
29712  const char *name = NULL;
29713  PyObject *res = NULL;
29714 #if PY_MAJOR_VERSION < 3
29715  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29716 #else
29717  if (likely(PyLong_Check(x)))
29718 #endif
29719  return __Pyx_NewRef(x);
29720 #if CYTHON_USE_TYPE_SLOTS
29721  m = Py_TYPE(x)->tp_as_number;
29722  #if PY_MAJOR_VERSION < 3
29723  if (m && m->nb_int) {
29724  name = "int";
29725  res = m->nb_int(x);
29726  }
29727  else if (m && m->nb_long) {
29728  name = "long";
29729  res = m->nb_long(x);
29730  }
29731  #else
29732  if (likely(m && m->nb_int)) {
29733  name = "int";
29734  res = m->nb_int(x);
29735  }
29736  #endif
29737 #else
29738  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29739  res = PyNumber_Int(x);
29740  }
29741 #endif
29742  if (likely(res)) {
29743 #if PY_MAJOR_VERSION < 3
29744  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29745 #else
29746  if (unlikely(!PyLong_CheckExact(res))) {
29747 #endif
29748  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29749  }
29750  }
29751  else if (!PyErr_Occurred()) {
29752  PyErr_SetString(PyExc_TypeError,
29753  "an integer is required");
29754  }
29755  return res;
29756 }
29757 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29758  Py_ssize_t ival;
29759  PyObject *x;
29760 #if PY_MAJOR_VERSION < 3
29761  if (likely(PyInt_CheckExact(b))) {
29762  if (sizeof(Py_ssize_t) >= sizeof(long))
29763  return PyInt_AS_LONG(b);
29764  else
29765  return PyInt_AsSsize_t(b);
29766  }
29767 #endif
29768  if (likely(PyLong_CheckExact(b))) {
29769  #if CYTHON_USE_PYLONG_INTERNALS
29770  const digit* digits = ((PyLongObject*)b)->ob_digit;
29771  const Py_ssize_t size = Py_SIZE(b);
29772  if (likely(__Pyx_sst_abs(size) <= 1)) {
29773  ival = likely(size) ? digits[0] : 0;
29774  if (size == -1) ival = -ival;
29775  return ival;
29776  } else {
29777  switch (size) {
29778  case 2:
29779  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29780  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29781  }
29782  break;
29783  case -2:
29784  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29785  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29786  }
29787  break;
29788  case 3:
29789  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29790  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29791  }
29792  break;
29793  case -3:
29794  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29795  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29796  }
29797  break;
29798  case 4:
29799  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29800  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29801  }
29802  break;
29803  case -4:
29804  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29805  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29806  }
29807  break;
29808  }
29809  }
29810  #endif
29811  return PyLong_AsSsize_t(b);
29812  }
29813  x = PyNumber_Index(b);
29814  if (!x) return -1;
29815  ival = PyInt_AsSsize_t(x);
29816  Py_DECREF(x);
29817  return ival;
29818 }
29819 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29820  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29821 }
29822 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29823  return PyInt_FromSize_t(ival);
29824 }
29825 
29826 
29827 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8